A simple wrapper for curl http://curl.haxx.se/
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test/units
.gitignore
.rvmrc
CHANGELOG.md
Gemfile
Gemfile.lock
MIT-LICENSE
README.md
Rakefile
curl_wrapper.gemspec

README.md

Gem Version

curl wrapper

curl_wrapper is a ruby wraper for the curl command.

install

  gem install curl_wrapper

use

  curl = CurlWrapper.new do |config|
    config.url 'rubygems.org'
  end
  puts curl.body
  curl = CurlWrapper.new do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
    config.verbose
    config.url 'http://hard_to_automate.sharepoint.com/resource'
  end

  curl.run
  puts curl.error

CurlWrapper is chanable

  puts CurlWrapper.new.url('rubygems.org').run.body
  curl = CurlWrapper.new do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
  end

  curl.verbose.url 'http://hard_to_automate.sharepoint.com/resource'

  puts curl.run.error

CurlWrapper is autoruns when you need the output

  puts CurlWrapper.new.url('rubygems.org').body
  curl = CurlWrapper.new do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
  end

  curl.verbose.url 'http://hard_to_automate.sharepoint.com/resource'

  puts curl.error

CurlWrapper just works so you can have fun exploring HTTP

lets just skip new and body and stil get what we want

  puts CurlWrapper.url('rubygems.org')
  curl = CurlWrapper do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
  end.verbose.url( 'http://hard_to_automate.sharepoint.com/resource' )

  puts curl