Hey All
As I started to use the new Rails Template Runner functionality
(thanks to lifo + jeremymcanally - it''s really awesome) I realized
some small missing methods that could make the template a lot more
powerful. One in particular was really already there - just embedded
within another method.
I just submitted a patch:
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1613-adding-environment-to-new-template_runner
That extracts the functionality for adding ''config.gem'' to the
Rails::Initializer block to its own method #environment.
The strongest use-case for this is adding or configuring load paths -
e.g.
environment "config.load_paths += %w[\#{Rails.root}/app/mailers \#
{Rails.root}/app/observers]"
It could also be used for adding observers:
environment "config.active_record.observers = :user_observer"
Or setting any arbitrary config method.
Heres the patch for easy viewing on github:
http://github.com/quirkey/rails/commit/6947592c772c67d4fdbaf397c6736eaa3be69363
Thanks!
--AQ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---
Since this email, Lifo urged me to write tests for the Template Runner (which has 0 tests in master currently). I''ve submitted another patch: http://rails.lighthouseapp.com/projects/8994/tickets/1618-test-coverage-and-refactor-of-template-runner#ticket-1618-1 Which refactors a bunch of the template runner (DRY) uses the logger instead of just ''puts'' and now has very good test coverage. Please test it out and let me know if I need to make more changes. I think this will let us progress the template runner in the light of the BIG NEWS. --AQ On Dec 22, 1:09 am, AQ <aa...@quirkey.com> wrote:> Hey All > > As I started to use the new Rails Template Runner functionality > (thanks to lifo + jeremymcanally - it''s really awesome) I realized > some small missing methods that could make the template a lot more > powerful. One in particular was really already there - just embedded > within another method. > > I just submitted a patch:http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/16... > That extracts the functionality for adding ''config.gem'' to the > Rails::Initializer block to its own method #environment. > > The strongest use-case for this is adding or configuring load paths - > e.g. > > environment "config.load_paths += %w[\#{Rails.root}/app/mailers \# > {Rails.root}/app/observers]" > > It could also be used for adding observers: > > environment "config.active_record.observers = :user_observer" > > Or setting any arbitrary config method. > > Heres the patch for easy viewing on github:http://github.com/quirkey/rails/commit/6947592c772c67d4fdbaf397c6736e... > > Thanks! > --AQ--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Since this email, Lifo urged me to write tests for the Template Runner (which has 0 tests in master currently). I''ve submitted another patch: http://rails.lighthouseapp.com/projects/8994/tickets/1618-test-coverage-and-refactor-of-template-runner#ticket-1618-1 Which refactors a bunch of the template runner (DRY) uses the logger instead of just ''puts'' and now has very good test coverage. Please test it out and let me know if I need to make more changes. I think this will let us progress the template runner in the light of the BIG NEWS. --AQ On Dec 22, 1:09 am, AQ <aa...@quirkey.com> wrote:> Hey All > > As I started to use the new Rails Template Runner functionality > (thanks to lifo + jeremymcanally - it''s really awesome) I realized > some small missing methods that could make the template a lot more > powerful. One in particular was really already there - just embedded > within another method. > > I just submitted a patch:http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/16... > That extracts the functionality for adding ''config.gem'' to the > Rails::Initializer block to its own method #environment. > > The strongest use-case for this is adding or configuring load paths - > e.g. > > environment "config.load_paths += %w[\#{Rails.root}/app/mailers \# > {Rails.root}/app/observers]" > > It could also be used for adding observers: > > environment "config.active_record.observers = :user_observer" > > Or setting any arbitrary config method. > > Heres the patch for easy viewing on github:http://github.com/quirkey/rails/commit/6947592c772c67d4fdbaf397c6736e... > > Thanks! > --AQ--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Looks awesome. Thanks for doing that; you did all the refactorings I didn''t have time to get to! :) --Jeremy On Fri, Dec 26, 2008 at 12:10 PM, AQ <aaron@quirkey.com> wrote:> > Since this email, Lifo urged me to write tests for the Template Runner > (which has 0 tests in master currently). > I''ve submitted another patch: > http://rails.lighthouseapp.com/projects/8994/tickets/1618-test-coverage-and-refactor-of-template-runner#ticket-1618-1 > > Which refactors a bunch of the template runner (DRY) uses the logger > instead of just ''puts'' and now has very good test coverage. Please > test it out and let me know if I need to make more changes. I think > this will let us progress the template runner in the light of the BIG > NEWS. > > --AQ > > > On Dec 22, 1:09 am, AQ <aa...@quirkey.com> wrote: >> Hey All >> >> As I started to use the new Rails Template Runner functionality >> (thanks to lifo + jeremymcanally - it''s really awesome) I realized >> some small missing methods that could make the template a lot more >> powerful. One in particular was really already there - just embedded >> within another method. >> >> I just submitted a patch:http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/16... >> That extracts the functionality for adding ''config.gem'' to the >> Rails::Initializer block to its own method #environment. >> >> The strongest use-case for this is adding or configuring load paths - >> e.g. >> >> environment "config.load_paths += %w[\#{Rails.root}/app/mailers \# >> {Rails.root}/app/observers]" >> >> It could also be used for adding observers: >> >> environment "config.active_record.observers = :user_observer" >> >> Or setting any arbitrary config method. >> >> Heres the patch for easy viewing on github:http://github.com/quirkey/rails/commit/6947592c772c67d4fdbaf397c6736e... >> >> Thanks! >> --AQ > > > >-- http://jeremymcanally.com/ http://entp.com/ http://omgbloglol.com My books: http://manning.com/mcanally/ http://humblelittlerubybook.com/ (FREE!) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---