Created
August 11, 2011 23:43
-
-
Save vivien/1141090 to your computer and use it in GitHub Desktop.
Passing arguments from one rake task to another
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
task :first, :arg1, :arg2 do |t, args| | |
puts "first" | |
Rake::Task[:second].invoke(args.arg1, args.arg2) | |
end | |
task :second, :arg1, :arg2 do |t, args| | |
puts "second" | |
puts args.arg1 | |
puts args.arg2 | |
end | |
__END__ | |
$ rake first[one,two] | |
first | |
second | |
one | |
two |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment