Singly

A Ruby Gem to interact with the Singly API.

Developed using straight-up bunder, as per these instructions.

Installation

This gem has not been released to rubygems yet. To install it manually:

git clone [email protected]:timehop/singly.git singly
cd singly
bundle install
rake install

Use in your project

Add Singly to your Gemfile:

gem "singly"

Then, initialize the gem. If you're using Rails, then this can be easily accomplished with an initializer file. Edit a file at config/initializers/singly.rb to include:

Singly.client_id = "<client_id>"
Singly.client_secret = "<client_secret>"
Singly.verbose = true # Set to false to disable logging

Use the gem directly

You may also experiment with this gem in a headless fashion (ie: without installing the gem):

git clone [email protected]:timehop/singly.git singly
cd singly
bundle install
rake console

This will look for an optional file at .config/console.rb where you can write arbitrary ruby code and have it loaded into your irb session.

For example, edit .config/console.rb to include:

Singly.client_id = "<client_id>"
Singly.client_secret = "<client_secret>"
Singly.verbose = true # Set to false to disable logging

This avoids having to configure your singly credentials every time you run rake console.

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