gdi / curb-fu

Simple, yet powerful wrapper for taf2's curb (libcurl) library

This URL has Read+Write access

dkastner (author)
Fri Oct 09 11:10:27 -0700 2009
commit  ba0887226caad83e75f08e9848f7b564bbf0d777
tree    434d269954698b3b2974f4bd97f7a6292c46e34f
parent  751712c62ca01065b3a783be3d963ae853f55381
name age message
file .gitignore Loading commit data...
file LICENSE Wed May 20 08:33:27 -0700 2009 added license [dkastner]
file README Wed May 20 08:33:27 -0700 2009 added license [dkastner]
file Rakefile Wed May 20 08:33:27 -0700 2009 updated README, removed dross from Rakefile [dkastner]
file curb-fu.gemspec
directory lib/
directory spec/
README
== curb-fu - easy-to-use wrapper around curb - the ruby wrapper around libcurl

* http://github.com/curb-fu

Curb can be found at http://github.com/taf2/curb

=== License

This gem is released under the terms of the Ruby license.  See the LICENSE file for details.

=== Prerequisites

* Ruby (tested on 1.8.7, 1.9.1)
* The Curb gem (and its libcurl dependency)
  * http://github.com/taf2/curb

=== Installation

  $ gem install curb-fu --source http://gems.github.com

Or, if you ahve the source:

  $ cd <source-dir>
  $ rake gem
  $ gem install pkg/

=== Examples

Urls can be requested using hashes of options or strings.  The GET, POST, PUT, and DELETE methods are supported 
through their respective methods on CurbFu and CurbFu::Request. 

==== String Examples

response = CurbFu.get('http://slashdot.org')
puts response.body

response = CurbFu.post('http://example.com/some/resource', { :color => 'red', :shape => 'sphere' })
puts response.body unless response.success?

==== Hash Examples

response = CurbFu.get(:host => 'github.com', :path => '/gdi/curb-fu')
puts response.body

response = CurbFu.post({:host => 'example.com', :path => '/some/resource'}, { :color => 'red', :shape => 'sphere' })
puts response.body unless response.success?


Have fun!