EventGirlClient
EventGirlClient can be used in your own app to send events to an external Event Girl Application such as event-girl.herokuapp.com. It is the gem for 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:
EventGirl::Client.configure do |config|
config.api_token = 'my-api-token'
config.url = 'http://my-eventgirl-endpoint.example.com'
end
The gem also includes a command line executable. See event_girl -h
for further details.
Installation
Add this line to your application's Gemfile:
gem 'event_girl_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install event_girl_client
Usage
Get the URL you want to send the event to (example: www.event-girl.herokuapp.com/incoming_events)
Create a remote side and get its API token via the Event Girl application.
Create an instance and start sending events:
client = EventGirl::Client.new('http://example.com', 'mytoken')
client.send! 'hello from event girl client'
You can optionally send additional payload data:
client = EventGirl::Client.new('http://example.com', 'mytoken')
client.send! 'hello from event girl client', 'Optional additional data that will not be matched'
Contributing
- 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