Rake question: How to call a task from a different namespace

How does one call from inside a namespace, a task from another
namespace?

namespace :foo do
task :a do
puts “Hello from task a!”
end
end

namespace :bar do
task :b do
Rake::Task[:foo][:a] # How to call foo:a ???
end
end

Thanks!

~Wayne

s///g
Wayne E. Seguin
Sr. Systems Architect & Systems Administrator

On Aug 20, 2007, at 12:48, Wayne E. Seguin wrote:

task :b do
Rake::Task[:foo][:a] # How to call foo:a ???
end
end

Rake::Task[‘foo:a’].invoke

#invoke will only run a task once. If you want to force it to run
(minus any prerequisites) call #execute.

On Aug 20, 2007, at 16:44 , Eric H. wrote:

Rake::Task[‘foo:a’].invoke

#invoke will only run a task once. If you want to force it to run
(minus any prerequisites) call #execute.

Thank you kindly!

~Wayne

s///g
Wayne E. Seguin
Sr. Systems Architect & Systems Administrator

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs