Hyperquest
Installation
Add this line to your application's Gemfile:
gem 'hyperquest'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hyperquest
Usage
require "hyperquest"
h = Hyperquest.get([url1, url2, url3])
# => Hash<url1 => Response, url2 => Response, url3 => Response>
h = Hyperquest.head([url1, url2, url3])
# => Hash<url1 => Response, url2 => Response, url3 => Response>
h[url1].uri
# => "http://example.com"
h[url1].content_length
# => 2435
h[url1].content_type
# => "text/html; charset UTF-8"
h[url1].body
# => "<HTML..."
h[url1].status
# => 200
h[url1].error
# => ""
h[url1].success?
# => true
h[url1].failed?
# => false
Development
This gem is powered by Go 1.5's functionality of creating shared C libraries.
If you're on a mac, you can also install Go with homebrew: brew install go
. Please remember to bundle
first!
Contributing
- Fork it ( https://github.com/berfarah/hyperquest/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