Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The DSL for multitask doesn't support passing args to the multitask (patch+test included) #125

Merged
merged 2 commits into from Oct 13, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,5 @@
/coverage
/html
/pkg

.DS_Store
4 changes: 2 additions & 2 deletions lib/rake/dsl_definition.rb
Expand Up @@ -78,8 +78,8 @@ def directory(dir)
# Example:
# multitask :deploy => [:deploy_gem, :deploy_rdoc]
#
def multitask(args, &block)
Rake::MultiTask.define_task(args, &block)
def multitask(*args, &block)
Rake::MultiTask.define_task(*args, &block)
end

# Create a new rake namespace and use it for evaluating the given
Expand Down
8 changes: 8 additions & 0 deletions test/test_rake_multi_task.rb
Expand Up @@ -47,5 +47,13 @@ def test_all_multitasks_wait_on_slow_prerequisites
assert @runs.index("B0") < @runs.index("B1")
assert @runs.index("B1") < @runs.index("B2")
end

def test_multitasks_with_parameters
task :a, [:arg] do |t,args| add_run(args[:arg]) end
multitask :b, [:arg] => [:a] do |t,args| add_run(args[:arg]+'mt') end
Task[:b].invoke "b"
assert @runs[0] == "b"
assert @runs[1] == "bmt"
end
end