Skip to content

Instantly share code, notes, and snippets.

@troygoode
Created July 27, 2010 18:47
Show Gist options
  • Save troygoode/492661 to your computer and use it in GitHub Desktop.
Save troygoode/492661 to your computer and use it in GitHub Desktop.
require 'rake'
def foo(task, name, *args)
args || args = []
args.insert 0, task
body = lambda {
puts 'Hello, ' + name
}
Rake::Task.define_task *args, &body
end
foo :bar, 'Troy'
task :default => [:bar]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment