davetron5000/methadone — pull request #20 by charlietanksley (2012-01-22 04:32:07+00:00)
Title: Fix bug caused by bundler 1.1 upgrade

Bundler 1.1 changes the name of the block variable in a gemspec (from `s` to `gem`). This means you get an error message like this when you run `bundle install` on a new methadone generated project:

```
1.9.2-p290 one-nine-two (git:master+*:)
$ bundle install
Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/Users/charlietanksley/tmp/methadone-tests/one-nine-two/one-nine-two.gemspec:17:in `block in

': undefined local variable or method `s' for main:Object (NameError)
```

This patch fixes the problem. There weren't any relevant tests, and I didn't know how you'd want to test the output of the templates, so I didn't write any tests. But I'm happy to if you give me instructions. The code to determine whether to use `s` or `gem` in the gemspec is a little hacky. The change to bundler happens in commit 86dd35b516b4a017db8d50eb71796bcb101e1d2c (seen here: https://github.com/carlhuda/bundler/commit/86dd35b516b4a017db8d50eb71796bcb101e1d2c), and it is between versions 1.1.pre.4 and 1.1.pre.5 of bundler, so I couldn't figure out a simpler way to determine this variable name.