Rails Envy: Ruby on Rails Rake Tutorial (aka. How rake turned...
Popularity Report
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
URL Tag Cloud
Groups (1)
Bookmark History
Saved by 41 people (11 private), first by anonymouse user on 2007-06-11
- Jedatu on 2008-08-26 - Tags ruby , make , rake , tutorials , programming , continuousintegration , deployment
- Mgurnett on 2008-06-17 - Tags rails
- Alleylab on 2008-05-10 - Tags rails , rake
- Raecoo on 2008-04-14 - Tags rake
- Pmaciver on 2008-03-27 - Tags Development_Rails_Blogs
Public Sticky notes
Highlighted by draconid
Highlighted by mrhsudiigo
Rake Namespaces
Once you become an alcoholic and you're using lots of Rake tasks, you may need a better way to categorize them. This is where namespaces come in. If I were to use namespaces in the above example, it might look like this:
Highlighted by alleylab
As you can see, there is only one step to get access to your models, the "=> :environment" thing:
- task(:send_expire_soon_emails => :environment) do
To run this task on my development db I would run "rake utils:send_expire_soon_emails". If I wanted to run this on my production database, I would run "rake RAILS_ENV=production utils:send_expire_soon_emails".
Highlighted by vincent
Highlighted by vincent


Public Comment