Project

gorilla-io

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for the Gorilla.io API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
~> 3.0

Runtime

 Project Readme

Gorilla.io API client for Ruby

Build Status

A Ruby wrapper for the Gorilla.io API.

Installation

Add this line to your application's Gemfile:

gem 'gorilla-io'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gorilla-io

Configuration

Options Default Description
api.url https://api.gorilla.io The Gorilla API url (probably won't change this).
api.version 1 The desired Gorilla API version.
api.key ENV['GORILLA_API_KEY'] Your Gorilla API key.
api.secret ENV['GORILLA_API_SECRET'] Your Gorilla API secret.
api.token_duration 300 (5 minutes) Amount in seconds generated signatures are good for.
user_agent Gorilla Ruby Client/{version} The user agent for the client.
client_adapter Faraday.default_adapter Enables easily changing the adapter in a test enviornment.

Configuring Clients

You can configure all clients globally, or you can configure any api option from above on a per-client basis:

Gorilla.configure do |c|
  c.api.key 'your-key'
  c.api.secret 'your-secret'
end

# Uses the global config
client = Gorilla::Client.new

# Uses the global config, overrides key & secret
client = Gorilla::Client.new({
  key: 'other-key',
  secret: 'other-secret'
})

You can also customize the Faraday middleware stack by passing a block to the client that will be passed a Faraday::Connection and a hash of the current api options. In fact, Gorilla::Client is just a Gorilla::VanillaClient that does just that.

gorilla_client = Gorilla::VanillaClient.new do |conn, options|
  conn.request :api_version, options[:version]
  conn.request :signature_auth, options
end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/gorilla-client/fork )
  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 a new Pull Request