Popularity
3.7
Growing
Activity
2.6
Declining
242
11
75

Description

Sawyer is an experimental secret user agent built on top of Faraday.

Think of Faraday as the nerdy scientist behind an HTTP API. Sure, he knows the technical details of how to communicate with an application. But he also gets overly obsessive about alternate timelines to be of much use.

Sawyer knows what needs to be done. He gets in there, assesses the situation, and figures out the next action.

Code Quality Rank: L5
Monthly Downloads: 4,399,954
Programming language: Ruby
License: MIT License
Tags: HTTP    
Latest version: v0.8.2

Sawyer alternatives and similar gems

Based on the "HTTP" category.
Alternatively, view Sawyer alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Sawyer or a related project?

Add another 'HTTP' Gem

README

Sawyer

Sawyer is an experimental hypermedia agent for Ruby built on top of Faraday.

Installation

Add this line to your application's Gemfile:

gem 'sawyer'

And then execute:

bundle

Or install it yourself as:

gem install sawyer

Usage

require "sawyer"

# Create a Sawyer agent
agent = Sawyer::Agent.new("https://api.github.com",
  links_parser: Sawyer::LinkParsers::Simple.new)

# Fetch the root of the API
root = agent.root.data

# Access a resource directly
contributors = agent.call(:get, "repos/lostisland/sawyer/contributors").data

# Load a hypermedia relation
top_contributor = contributors.first
followers = top_contributor.rels[:followers].get.data

For more information, check out the documentation.

Development

After checking out the repo, run script/test to bootstrap the project and run the tests. You can also run script/console for an interactive prompt that will allow you to experiment.

To package the gem, run script/package. To release a new version, update the version number in [lib/sawyer.rb](lib/sawyer.rb), and then run script/release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Check out the [contributing guide](CONTRIBUTING.md) for more information on contributing.

License

The gem is available as open source under the terms of the MIT License.


*Note that all licence references and agreements mentioned in the Sawyer README section above are relevant to that project's source code only.