rmehner/badgeville — pull request #2 by mrnugget (2012-06-05 10:30:42+00:00)
Title: Badgeville.configure accepts block to configure client

I modified the `Badgeville.configure` method to accept a block too and in order to make this work in a nice way I also modified `Badgeville::Client#initialize`. Now it's possible to configure the client with a block, like this:

```ruby
Badgeville.configure do |config|
config.private_key = 'my_private_api_key'
config.protocol = 'http'
# [...] and so on
end
```

That, I think, is much more readable, especially if you want to use an initializer in which you can write comments next to each option. But I didn't want to break the deprecated methods of the client and so it's still possible to use an options hash to configure the client:

```ruby
Badgeville.configure(private_key: 'my_private_key', site: 'example.org', protocol: 'https')
```

Also I tried not to break with the behaviour of getting default values for `timeout`, `host` and `protocol` from the globals defined in `client.rb`.

So, what do you think? I'd be happy about feedback :)