Skip to content

Instantly share code, notes, and snippets.

@chensoren
Created November 18, 2011 01:58
Show Gist options
  • Save chensoren/1375314 to your computer and use it in GitHub Desktop.
Save chensoren/1375314 to your computer and use it in GitHub Desktop.
Rake task with arguments and :environment
desc "Rake task with arguments and :environment"
task :task_name, [:arg1, :arg2] => :environment do |t, args|
args.with_defaults(:arg1 => "Foo", :arg2 => "Bar")
puts "Hello, #{args.arg1}. Bye, #{args.arg2}."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment