Skip to content

Commit

Permalink
Merge pull request #125 from michaeljbishop/multitask+args
Browse files Browse the repository at this point in the history
The DSL for multitask doesn't support passing args to the multitask (patch+test included)
  • Loading branch information
jimweirich committed Oct 13, 2012
2 parents 0ffa029 + 4f0e44b commit aef4446
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
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

0 comments on commit aef4446

Please sign in to comment.