Rhapsody gem
Still under development
Rhapsody gem provides a Ruby object-oriented interface for Rhapsody API.
Installation
Add this line to your application's Gemfile:
gem 'rhapsody'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rhapsody
Usage
Setting up a client
A client prepares you to make calls to Rhapsody API. Here is an example code for setting up a client using implicit method.
require 'rhapsody'
= {
api_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
api_secret: 'yyyyyyyyyyyy',
auth_code: 'zzzzzzzzzz',
redirect_url: 'http://example.com/rhapsody/auth'
}
client = Rhapsody::Client.new()
client.connect
Running tests
Rhapsody gem uses RSpec and FactoryGirl.
Get the API key and API secret from Rhapsody Developers site.
Create a file called
config.ymlinspecdirectory.Add the following with the correct API key and API secret
config_variables:
API_KEY: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
API_SECRET: "yyyyyyyyyyyy"
$ bundle install$ rspec
Contributing
- Fork it ( https://github.com/[my-github-username]/rhapsody/fork )
- 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 a new Pull Request