Project

rest_baby

0.0
No commit activity in last 3 years
No release in over 3 years
Rest client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0.7
>= 2.1.0, ~> 2.1
~> 0
>= 2.14.1, ~> 2.14
~> 0.11
>= 1.13.0, ~> 1.13

Runtime

>= 1.8.0, ~> 1.8
~> 1.6
 Project Readme

rest_baby

Small rest client, supports ruby-2.0.0, ruby-2.1.0, and ruby-2.2.0. You can only run reek with ruby 2.1 or above. You could use jruby but some develop dependencies are not supported any longer, including coveralls and yard-cucumber.

Item Status
Gem Gem Version
Dependencies Dependency Status
Build/Test Build Status
Coverage Coverage Status
Code Analysis Code Climate
Docs Inline docs
codeship Codeship Status for dmcnulla/rest_baby

Purpose

Rest_baby is a rest client that retains key server & authorization settings, keeping your code dryer. It has been used for automated tools that test restful interfaces. It has grown to over 5k downloads with only 5 reported issues as of this writing.

Installation

Add this line to your application's Gemfile:

gem 'rest_baby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rest_baby

Use

client = RestBaby::Client.new('http://gis.srh.noaa.gov/arcgis/rest/services/System')
# get(HEADERS, PATH, PARAMETERS)
# returns http response, usually the body is what is wanted.
message = JSON.parse(client.get( { 'Accept' => 'application/json' },
                                   '/ReportingTools/GPServer/info/iteminfo',
                                   {'f' => 'pjson'}).body)

client = RestBaby::Client.new('http://127.0.0.1:9001')
# post(BODY, HEADERS, PATH)
message = JSON.parse(client.post('{ "name": "Ben Franklin" }',
                                { 'Content-Type' => 'application/json' },
                                '/person').body)
# or
message = JSON.parse(client.post({ "name" => "Ben Franklin" }.to_json,
                                 { 'Content-Type' => 'application/json' },
                                 '/person').body)

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