RailsApps/rails_apps_composer — pull request #65 by bryanstearns (2012-05-23 00:34:05+00:00)
Title: Handling of standalone gems

Hi Daniel,

Thanks for including my last pull; this one might be more controversial, but I figured I'd bring up the idea and see what you think:

Now that I have my defaults files, I'd like to be able to easily add extra gems to them, without having to write a whole recipe for each gem; there are a few that I throw into all my projects (like debugger, etc). I wasn't sure about the best way to accomplish this, but it was pretty simple to add a 'gems' recipe, and I was going to make it prompt for the list of gem names to include...

but I decided to go a step further and try treating gems as first-class citizens: I added a --gems command-line option, and I changed the interactive prompting to list gems that have been added, and to treat any unknown recipe name as a gem name (though it doesn't check that it's really a gem). Before handing off to the template, it sets up the list as configuration for that 'gems' recipe (which I've made 'internal', so it doesn't appear in the list).

Only gem names can be specified on the command line or interactively, but the defaults file syntax allows specification of the other options that you'd put in your Gemfile, like:
```
recipes:
- git
- activerecord
- home_page

gems:
- debugger:
- group:
- :development
- :test
- fastercsv
- formtastic:
- '~> 1.2.4'

activerecord:
database: sqlite3
auto_create: true
```

Like I said, I'm not sure all of this is the best way to accomplish this feature (or even that you'll think this is a worthwhile addition!), but I'd appreciate your feedback and I'll rework it as you see fit.

Thanks again ...Bryan