Fixing BUNDLE_WITHOUT on Heroku Cedar
While I was working on the lacunavinea.org web site (it's not linked as it isn't live yet), I ran into an issue with bundler on Heroku. Heroku Cedar has BUNDLE_WITHOUT hard-coded to exclude only development and test.
This is rather limiting if you want to have other groups in your Gemfile that don't get inlucded in the running app. Cucumber users will especially notice this, as the cucumber folks suggest you put the cucumber gems in the own group. I also like to put gems like heroku and ZenTest in their own group.
I went looking to see if anyone else had found a solution, and I came across this tweet by @grosser.
BUNDLE_WITHOUT on heroku cedar -> Gemfile: cucumber = (ENV['HOME'].gsub('/','') == 'app' ? 'test' : 'cucumber'); group cucumber do ... end
— Michael Grosser (@grosser) December 15, 2011
I thought I would give a more expanded example here, as it look me a moment to realize what he meant. Here's an example Gemfile that creates some groups. I also wrote a little helper function to make it a bit nicer looking.
Works like a charm! Thanks @grosser!