Mole
Easily send events to Orwell from your Ruby applications.
Installation
Add this line to your application's Gemfile:
gem 'orwell-mole', require: 'orwell/mole'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install orwell-mole
And require it:
require 'orwell/mole'
Configuration
Currently there is only one required configuration option: api_token
.
Mole.config do |c|
c.api_token = 'your orwell api token'
c.method = :sidekiq
end
Options
api_token
- The application's API token provided by Orwell.method
- Set the transport used by Mole to transmit events, valid options::basic_http
- No frills HTTP requests vianet/http
, the default.:sucker_punch
- Uses SuckerPunch to asynchroniously transmit events.:sidekiq
- Similar to:sucker_punch
but the underlying library is Sidekiq.
Note: To use either :sucker_punch
or :sidekiq
you'll need to require them first:
# Sidekiq
require 'orwell/mole/transport/sidekiq'
# SuckerPunch
require 'orwell/mole/transport/sucker_punch'
Usage
To record an event all we need to do is:
Mole.record(:new_tweet, tweet: '...', timestamp: '...')
Contributing
Feedback and fixes are always welcome. Please make use of Issues and Pull Requests, all code should have test coverage.
Author/Contact
Mole is written and maintained by @doomspork.
License
Mole is made available under the MIT License.