Skip to content
A minimum-viable Amazon Web Services (AWS) client
Ruby
Find file
Pull request Compare This branch is 162 commits behind hakanensari:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
lib
spec
.gitignore
.travis.yml
Gemfile
Guardfile
LICENSE
README.md
Rakefile
jeff.gemspec

README.md

Jeff

Jeff is a light-weight module that mixes in client behaviour for Amazon Web Services (AWS). It wraps Excon, parses with Nokogiri, and implements Signature Version 2.

jeff

Usage

Build a a hypothetical client.

class Client
  include Jeff
end

Customise default headers and parameters.

class Client
  headers 'User-Agent' => 'Client'
  params  'Service'    => 'SomeService',
          'Tag'        => -> { tag }

  attr_accessor :tag
end

Set an AWS endpoint and credentials.

client = Client.new.tap do |config|
  config.endpoint = 'http://example.com/path'
  config.key      = 'key'
  config.secret   = 'secret'
end

You should now be able to access the endpoint.

res = client.post query: {},
                  body:  'data'

puts res.status    # => 200
puts res.body.root # => { 'Foo' => 'Bar' }

Chunked Requests

You can upload large files performantly by passing a proc that delivers chunks.

file = File.open 'data'
chunker = -> { file.read Excon::CHUNK_SIZE).to_s }

client.post query:         {},
            request_block: chunker

Compatibility

Jeff is compatible with all Ruby 1.9 flavours.

Something went wrong with that request. Please try again.