bernd/fpm-cookery — pull request #7 by lusis (2011-10-28 05:31:27+00:00)
Title: Alternate providers

This commit adds a framework for alternate providers and provides an SVN provider. The alternate provider is specified using the hash `:with => :provider`.

If no provider is specified, the default provider is :curl.

Additionally, the SVN provider supports a specific revision via `:revision => '12345'. Default revision is `HEAD`

Here's an example recipe fragment:

```ruby
class Redis < FPM::Cookery::Recipe
homepage 'http://redis.io'
# different source methods
#source 'https://github.com/antirez/redis/trunk', :with => :svn
#source 'https://github.com/antirez/redis/trunk', :with => :svn, :revision => '2400'
source 'http://redis.googlecode.com/files/redis-2.4.2.tar.gz'
md5 'c4b0b5e4953a11a503cb54cf6b09670e'

name 'redis-server'
version '2.4.2'
```

The ability to do checksums has been made a toggle that's set to `true` by default. Providers can override this by setting the constant `CHECKSUM` to `false` in the subclassed provider:

```ruby
module FPM
module Cookery
class SourceHandler
class MyCoolHandler < FPM::Cookery::SourceHandler::Template

CHECKSUM = false
NAME = :my_cool_handler

def fetch
# ....
end

def extract
# ....
end
end
end
end
end
```