peterhellberg/pinch — pull request #4 by MrGossett (2012-06-20 14:41:05+00:00)
Title: added support for HTTP Basic Authentication

Added support for HTTP Basic Authentication using two new optional attributes: `user` and `pass`:

Pinch.new('http://code.mrgossett.com/pinch_test.zip', 'pinch_test','thisisjustatest')

Also added a new method `#auth` that sets the username and password on a Pinch instance. `#auth` returns `self`, so it can be chained with other methods:

Pinch.new('http://code.mrgossett.com/pinch_test.zip').auth('pinch_test', 'thisisjustatest').get('data.json')

Added two spec tests to make sure it works with valid authentication and doesn't work with invalid authentication. All RSpec tests are passing.