Skip to content

Commit

Permalink
Merge pull request #189 from PChambino/reenable_with_task_args
Browse files Browse the repository at this point in the history
Parse task string to reenable task
  • Loading branch information
gabskoro committed May 14, 2014
2 parents ce41ce2 + 6d499ea commit 835ea2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/mina/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ module Helpers

def invoke(task, options = {})
Rake.application.invoke_task task
Rake::Task[task].reenable if options[:reenable]
if options[:reenable]
name = Rake.application.parse_task_string(task).first
Rake::Task[name].reenable
end
end

# ### erb
Expand Down
15 changes: 15 additions & 0 deletions spec/dsl/invoke_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@

rake.commands.should == ['git pull', 'git pull']
end

it '#invoke with task arguments should work with :reenable option' do

rake {
task :hello, [:world] do |t, args|
queue "echo Hello #{args[:world]}"
end
}

%w(World Pirate).each { |name|
rake { invoke :"hello[#{name}]", :reenable => true }
}

rake.commands.should == ['echo Hello World', 'echo Hello Pirate']
end
end

0 comments on commit 835ea2f

Please sign in to comment.