<commit_before>[![Build Status](https://travis-ci.org/interagent/heroics.png?branch=master)](https://travis-ci.org/interagent/heroics)
# Heroics

Ruby HTTP client generator for APIs represented with JSON schema.

## Installation

Add this line to your application's Gemfile:

    gem 'heroics'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install heroics

## Usage
<commit_msg>Document config file in README<commit_after>[![Build Status](https://travis-ci.org/interagent/heroics.png?branch=master)](https://travis-ci.org/interagent/heroics)
# Heroics

Ruby HTTP client generator for APIs represented with JSON schema.

## Installation

Add this line to your application's Gemfile:

    gem 'heroics'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install heroics

## Usage

### Configuration File

If you don't want to pass config to the CLI, you can provide a Ruby config file to the `heroics-generate` script as a single parameter.

The form of this configuration file is shown below.

```ruby
require 'heroics'

Heroics.default_configuration do |config|
  config.base_url = 'https://example.com'
  config.module_name = 'ExampleClient'
  config.schema_filepath = 'schema.json'

  config.headers = { 'Accept' => 'application/vnd.example+json; version=1' }
  config.cache_path = "#{Dir.home}/.heroics/example"
end
```

#### Optional configuration

`config.headers` and `config.cache_path` are optional, but all other config shown above is required.

For further details on config file usage, see the `example/` directory in this repo.

{'fraction_non_alphanumeric': 0.10522999369880277, 'fraction_numerical': 0.000630119722747322, 'mean_word_length': 4.3830508474576275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1475681', 'n_tokens_mistral': 489, 'n_tokens_neox': 465, 'n_words': 160}