12spokes/tandem — pull request #3 by amazing-jay (2011-12-01 03:28:41+00:00)
Title: [Ethan][#21562613,#21564785,#21686659,#21562657] cancan integration, generators, initializers (API), layouts

Upgraded Generator to create layouts, and log creation of initializer (instead of just copying it)
DRYd up 'generated' files in the dummy app by pointing to the generator templates
- Added extra layout lookup to view PATHs for locating layouts specific to gem development
Added layout selection logic to the controllers
Added option to customize where layouts are kept
Enabled cancan authorization redirection, with configuration option
Refactored API to be much more 'rails like' and easy to understand.

Thanks Ethan, your suggestion to call define_method and pass in an existing block was exactly what I was stumbling around trying to find; and now it makes Duh sense! - somehow I just forgot that blocks reference their own bindings, and that evoking the block in a define_method call would obviously reset the binding; because it is by definition 'defining the method', forming the first part of the closure... DUH