<commit_before># NomadClient

Client gem for interacting with Hashicorp's [Nomad HTTP API](https://www.nomadproject.io/docs/http/).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'nomad_client'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install nomad_client

## Usage

### Initialisation
For a default client

```ruby
NomadClient::Client.new('https://nomad.local')
```

Or to override default configuration

```ruby
NomadClient::Client.new('https://nomad.local') do |config|
  config.port = 4647
  config.api_base_path = '/v2'
end
```

## Development

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/xyzjace/nomad_client.
<commit_msg>Update README for usage of the gem<commit_after># NomadClient

Client gem for interacting with Hashicorp's [Nomad HTTP API](https://www.nomadproject.io/docs/http/).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'nomad_client'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install nomad_client

## Usage

### Initialisation
For a default client

```ruby
nomad_client = NomadClient::Client.new('https://nomad.local')
```

Or to override default configuration

```ruby
nomad_client = NomadClient::Client.new('https://nomad.local') do |config|
  config.port = 4647
  config.api_base_path = '/v2'
end
```

### Querying endpoints

```ruby
job = nomad_client.job.get('my-job-id') # returns a Faraday::Response

if job.success?
  job.body # A Hashie::Mash of the JSON payload returning from the job/my-job-id API endpoint
else
  # handling of errors here
end
```


## Development

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/xyzjace/nomad_client.

{'fraction_non_alphanumeric': 0.1226890756302521, 'fraction_numerical': 0.0056022408963585435, 'mean_word_length': 4.395770392749244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6752542', 'n_tokens_mistral': 617, 'n_tokens_neox': 566, 'n_words': 175}