chrismccord/sync — pull request #18 by joshmcarthur (2013-04-28 05:07:30+00:00)
Title: Support ERB in sync.yml

@chrismccord,

First of all, thanks for this project. I've tried both Faye (via [PrivatePub](https://github.com/ryanb/private_pub) and Pusher before, but it's never really clicked nicely until Sync came along.

One thing that I've found myself having to monkey-patch into this project though, is the ability to have ERB parsed in my `config/sync.yml` files. In my case, this is so I can have my `sync.yml` file sitting in source control, while keeping all my secrets in environment variables on the server (or on Heroku).

Something like this:

``` yaml
production:
adapter_javascript_url: "http://js.pusher.com/2.0/pusher.min.js"
app_id: <%= ENV['PUSHER_APP_ID'] %>
api_key: <%= ENV['PUSHER_API_KEY'] %>
auth_token: <%= ENV['PUSHER_SECRET'] %>
adapter: "Pusher"
async: true
```

Because I've had to do this for a couple of projects I'm working on now, I've forked and updated `Sync` to parse ERB within the YAML file, hence this pull request.

I've also added a test to ensure that ERB is indeed parsed within the file - for this I added an additional fixture, as I didn't want to modify your own fixtures intended for testing Faye or Pusher. I believe that this single test should adequately test the new functionality, but let me know if you see any use cases that I've missed. I'm also happy to update the language or style of the test to be consistent with the others.

Thanks!