This link has been bookmarked by 204 people . It was first bookmarked on 11 Jun 2007, by a77ila.
-
18 Jun 17
kevinoempty
-
27 Sep 11
-
07 Jul 09
-
27 May 09
-
19 May 09
-
18 May 09
-
12 May 09
-
04 May 09
Rodrigo de OliveiraTutorial engraçadinho de uso do rake
-
13 Apr 09
-
09 Apr 09
-
06 Apr 09
-
01 Apr 09
-
09 Mar 09
-
12 Feb 09
-
02 Feb 09
-
30 Jan 09
-
22 Jan 09
-
08 Jan 09
-
27 Oct 08
-
22 Oct 08
-
25 Sep 08
-
15 Sep 08
-
27 Aug 08
-
26 Aug 08
-
16 Aug 08
-
29 Jun 08
-
17 Jun 08
-
29 May 08
-
26 May 08
-
22 May 08
-
10 May 08
-
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:
-
-
14 Apr 08
-
04 Apr 08
-
24 Mar 08
-
23 Mar 08
-
21 Mar 08
-
20 Mar 08
-
18 Mar 08
-
10 Mar 08
-
06 Mar 08
-
03 Mar 08
-
26 Feb 08
-
11 Feb 08
-
10 Feb 08
-
05 Feb 08
-
31 Jan 08
-
16 Jan 08
-
08 Jan 08
-
06 Jan 08
-
28 Dec 07
-
11 Dec 07
-
28 Nov 07
-
24 Nov 07
-
21 Nov 07
-
14 Nov 07
-
08 Nov 07
-
07 Nov 07
-
27 Oct 07
-
09 Oct 07
-
11 Sep 07
-
10 Sep 07
-
23 Aug 07
-
22 Aug 07
-
20 Aug 07
Mathieu MartinThe greatest and funniest tutorial ever! About Rake, Ruby's flexible (and comprehensible) version of make.
-
11 Aug 07
-
10 Aug 07
Matti NarkiaAs a Rails developer you're probably familiar with running "rake" to run your tests or maybe you've used "rake db:migrate" to run your migrations. But do you really understand what's going on under the hood of these Rake tasks? Did you realize that you ca
-
12 Jul 07
-
09 Jul 07
-
- task(:send_expire_soon_emails => :environment) do
As you can see, there is only one step to get access to your models, the "=> :environment" thing:
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".
-
As you can see, there is only one step to get access to your models, the "=> :environment" thing:
-
If I then wanted this to run nightly on my production database at midnight, I might write a cronjob that looks something like this:
0 0 * * * cd /var/www/apps/rails_app/ && /usr/local/bin/rake RAILS_ENV=production utils:send_expire_soon_emails
Pretty convenient!
-
-
30 Jun 07
-
28 Jun 07
-
19 Jun 07
-
17 Jun 07
-
you start to notice that some tasks might partially repeat themselves
-
-
16 Jun 07
-
15 Jun 07
-
14 Jun 07
-
13 Jun 07
-
Avinash MeetooAs a Rails developer you're probably familiar with running "rake" to run your tests or maybe you've used "rake db:migrate" to run your migrations. But do you really understand what's going on under the hood of these Rake tasks? Did you realize that you ca
ruby rubyonrails rake rails tutorial howto programming weblog article development documentation examples productivity scripting tools web utility
-
12 Jun 07
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.