P
Peter Pk
is there a way to "explicitly" invoke a block inside the scope of a
parent or explicit "root relative" rake namespace instead of always
being a child of the current namespace ???
namespace :xxx do
namespace :yyy do
namespace ...
... called_in_unknown_namespace(arg);
end
end
end
def called_in_unknown_namespace(arg)
# execute below block as if it were in "root" namespace
namespace 'root namespace' do
# declare additional item to do in root namespace task
task :task_in_root do
puts('invoked by "rake task_in_root"');
end
end
# scope restored to wherever you were previously
end
Thanks!
parent or explicit "root relative" rake namespace instead of always
being a child of the current namespace ???
namespace :xxx do
namespace :yyy do
namespace ...
... called_in_unknown_namespace(arg);
end
end
end
def called_in_unknown_namespace(arg)
# execute below block as if it were in "root" namespace
namespace 'root namespace' do
# declare additional item to do in root namespace task
task :task_in_root do
puts('invoked by "rake task_in_root"');
end
end
# scope restored to wherever you were previously
end
Thanks!