Build Status

Rainforest-client

API Client for RainForest

Installation

$ gem install rainforest-client

or if you use a Gemfile

gem 'rainforest_client'

or you can use direcly from github

gem 'rainforest-client', 
    :git => 'https://github.com/kureikain/rainforest-gem',
    :branch => 'master'

Usage

You can access end-point directly, via request method and receive JSON data back. Or use resource wrapper.

Access API directly

require 'rubygems'
require 'rainforest-client'

Rainforest::Client.api_key="1f98f025af50d0d6732e79625abb5a06"

api = Rainforest::Client.new
payload = {tests: [2286]}

runs = api.request('runs', payload)
puts runs

# Or to get runs    
runs = api.request('runs', payload, :get)
puts runs

# Get a particular resource

runs = api.request('runs/2286', {}, :get)
puts runs

# Delete a run

runs = api.request('runs/2286', {run: 2286}, :delete)
puts runs

Or via object/resource wrapper (In development. Checkout dev branch)

runs = Rainforest::Runs.new
puts runs.retrieve

puts runs.retrieve 4208898
puts runs.delete

# These are not implemented yet
test = Rainforest::Tests.new
test.create

puts runs.retrieve 4208898

Test

$ rake spec

Changelog

v0.0.2

  • Separate API client and resource
  • Add error handle via parsing response from API endpoint

v0.0.1

  • Experimental