A library for interacting with web services (and building SOAs) at blinding speed.
A library for accessing web services in Ruby. It’s specifically designed for building service oriented architectures in Ruby that need to be fast enough to process calls to multiple services within an HTTP request/response life cycle.
For now HTTPMachine exists only on github. It also has a few gem requirements that are only on github. Before you start you need to have libcurl and libxml installed. If you’re on Leopard you have both. Otherwise, you’ll need to grab them. Once you’ve got those libraries, these are the gems that get used: nokogiri and taf2-curb (note that this is a fork that lives on github and not the Ruby Forge version of curb). The http-machine gemspec has all the dependencies so you should be able to get up and running with the standard github gem install routine:
gem sources -a http://gems.github.com # if you haven’t already
gem install pauldix-http-machine
NOTE:Some people have been reporting a few issues related to installation. First, the Ruby Forge version of curb is not what you want. It will not work. Nor will the curl-multi gem that lives on Ruby Forge. You have to get the taf2-curb fork installed.
If you see this error when doing a require:
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — curb_core (LoadError)
It means that the taf2-curb gem didn’t build correctly. To resolve this you can do a git clone git://github.com/taf2/curb.git then run rake gem in the curb directory, then sudo gem install pkg/curb-0.2.4.0.gem. After that you should be good.
If you’re on Debian or Ubuntu and getting errors while trying to install the taf2-curb gem, it could be because you don’t have the latest version of libcurl installed. Do this to fix:
sudo apt-get install libcurl4-gnutls-dev
Another problem could be if you are running Mac Ports and you have libcurl installed through there. You need to uninstall it for curb to work! The version in Mac Ports is old and doesn’t play nice with curb. If you’re running Leopard, you can just uninstall and you should be golden. If you’re on an older version of OS X, you’ll then need to download curl and build from source. Then you’ll have to install the taf2-curb gem again. You might have to perform the step above.
If you’re still having issues, please let me know on the mailing list. Also, Todd Fisher is working on the curb gem and wants to help resolve install issues. Please send him a full error report.
- This will have to be extensive as there are usage patterns that may be foreign to users.
- Put some notes here about how wickedly, insanely fast this library is.
- Add support for error handling. Automatic retry, exponential back-off, queuing for later
- Add server test suite
- Add put support
- Add support to get to pass in params in the options hash (instead of just as part of the url)
(The MIT License)
Copyright © 2009:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
‘Software’), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.