Created
August 15, 2012 20:06
-
-
Save hisea/3363163 to your computer and use it in GitHub Desktop.
Rake task with param and dependency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'resque/tasks' | |
namespace :ns do | |
desc "test task accepts param" | |
task :task, [:param] => [:environment] do |t,args| | |
abort "Please specify a param!" unless args[:param] | |
puts args[:param] | |
end | |
end | |
#To run: rake ns:task["param"] | |
#For zsh: noglob rake ns:task["param"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment