Skip to content

Instantly share code, notes, and snippets.

@hisea
Created August 15, 2012 20:06
Show Gist options
  • Save hisea/3363163 to your computer and use it in GitHub Desktop.
Save hisea/3363163 to your computer and use it in GitHub Desktop.
Rake task with param and dependency
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