tmlee/roomorama_api — pull request #2 by duhast (2013-11-08 12:42:12+00:00)
Title: Debug mode switch to prevent IO error

A call to `puts` inside `RoomoramaApi::Client#api_call` causes an IO error when running in a daemonized Resque worker:
```
Input/output error -
/var/www/app_staging/shared/bundle/ruby/1.9.1/gems/roomorama_api-0.3.0/lib/roomorama_api.rb:43:in `write'
/var/www/app_staging/shared/bundle/ruby/1.9.1/gems/roomorama_api-0.3.0/lib/roomorama_api.rb:43:in `puts'
...
```

As a fix, i propose to introduce debug mode (off by default) and use that condition to log debug stuff.

Also I've added _User Agent_ header to Faraday requests.