<commit_before># Hunch

Hunch is a rabbitmq client used for inter service communication inside our topware 
gaming platform. It is a broker/producer only gem. For a consumer please use hutch gem.

## Installation

Add this line to your application's Gemfile:

    gem "hunch", git: "http://192.168.100.16/servers/hunch.git"

And then execute:

    $ bundle

## Usage

```ruby
Hunch.configure do |c|
	c.logger = SemanticLogger[Hunch]
	# other custom initialization
end

Hunch.publish! "uaa.user_created", id: 1, username: "foobar", email: "<EMAIL>"

```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request<commit_msg>cli documentation<commit_after># Hunch

Hunch is a rabbitmq client used for inter service communication inside our topware 
gaming platform. It is a broker/producer only gem. For a consumer please use hutch gem.

## Installation

Add this line to your application's Gemfile:

    gem "hunch", git: "http://192.168.100.16/servers/hunch.git"

And then execute:

    $ bundle

## Usage

```ruby
Hunch.configure do |c|
	c.logger = SemanticLogger[Hunch]
	# other custom initialization
end

Hunch.publish! "uaa.user_created", id: 1, username: "foobar", email: "<EMAIL>"

# communication with post office service
Hunch.publish! "email.welcome", template_id: "welcome", to: "<EMAIL>",
				 data: { name: "iaintshine" }
```

## CLI

One can use debug console for testing. 

1. Copy the `.hunch.example` to `.hunch`, fill all the missing parts.
2. Call `bin/hunch console` to start up console with configured environment. 
3. Now to publish a message just call the `Hunch::publish!` method with routing key 
and message set as usage section shows.

## CLI commands

* `hunch console` - start a console with hunch environment configured. `.hunch` rc file is used for configuration if found. 
* `hunch publish` - publish a message to the rabbitmq. `.hunch` rc file is used for configuration if found. Options:
	* `-k`, *required*, string, routing key, eg. `-k=uaa.user_created`
	* `-m`, *required*, hash, message hash, eg. `-m=username:foobar`  
	* `-p`, *optional*, hash, additional exchange properties

For more info `bin/hunch help` or `bin/hunch help [COMMAND]`

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
{'fraction_non_alphanumeric': 0.11406551059730251, 'fraction_numerical': 0.014258188824662813, 'mean_word_length': 4.060428849902534, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5945259', 'n_tokens_mistral': 858, 'n_tokens_neox': 807, 'n_words': 336}