Ereignishorizont Client can be used in your own app to send events to an external Ereignishorizont Application such as ereignishorizont.herokuapp.com. It is the gem for Ereignishorizont (formerly known as 'Event Girl') which was part of a project for the Rails Girls Summer of Code. Its three main contributors are the Rails Girls Susanne and Tam, and their coach Carsten, who worked on the project from July 2 - September 30, 2013 at the ABSOLVENTA offices in Berlin.
Using an initializer file for Rails, you can do:
Ereignishorizont::Client.configure do |config|
config.api_token = 'my-api-token'
config.url = 'http://my-ereignishorizont-endpoint.example.com'
end
The gem also includes a command line executable. See ereignishorizont -h
for further details.
Add this line to your application's Gemfile:
gem 'ereignishorizont-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ereignishorizont-client
Get the URL you want to send the event to (example: https://ereignishorizont.herokuapp.com/incoming_events)
Create a remote side and get its API token via the Ereignishorizont application.
Create an instance and start sending events:
client = Ereignishorizont::Client.new('http://example.com', 'mytoken')
client.send! 'hello from ereignishorizont-client'
You can optionally send additional payload data:
client = Ereignishorizont::Client.new('http://example.com', 'mytoken')
client.send! 'hello from ereignishorizont-client', 'Optional additional data that will not be matched'
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request