23 Feb '12, 10pm

Rake tasks can take arguments

February 23, 2012 Tagged: command line rake ruby shell how to Comments (View) How To Use Arguments In a Rake Task I came across this today. You can write Rake tasks that accept arguments, called like this: rake tweets:send[cpytel] You define the rask task like this: namespace :tweets do desc 'Send some tweets to a user' task :send, [:username] => [:environment] do |t, args| Tweet.send(args[:username]) end end Unfortunately, zsh can’t parse the call to the rake task correctly, so you’ll see the error: zsh: no matches found: tweets:send[cpytel] So you’ll need to run it like this:

Full article: http://robots.thoughtbot.com/post/18129303042/how-to-use-...

Tweets

Giving a Rake Task Arguments #Ruby

robots.thoughtbot.com 23 Feb '12, 2pm

February 23, 2012 Tagged: ruby rake command line shell Comments (View) Giving a Rake Task Arguments I came across this tod...

@kei_s 参考になるかわかりませんが、最近Pivotal Labsブログにこんな記事があり...

pivotallabs.com 17 Feb '12, 7am

There are several reasons why you should test your Rake tasks: Rake tasks are code and as such deserve testing. When untes...

Arguments Against Dolphin Slaughter For years a...

dotearth.blogs.nytimes.com 25 Feb '12, 2pm

The film is an astonishing achievement. On your question about our relationship with fellow species, this question can be ...