module Rake::DSL
def namespace(name=nil, &block) # :doc:
end
# ...
task "nested:test" do
name:
Tasks can also be defined in a namespace by using a ":" in the task
task_run = ns[:run] # find :run in the given namespace.
end
task :run
# the "nested:run" task
ns = namespace "nested" do
Example:
tasks defined in the namespace.
block. Returns a NameSpace object that can be used to lookup
Create a new rake namespace and use it for evaluating the given
def namespace(name=nil, &block) # :doc: name = name.to_s if name.kind_of?(Symbol) name = name.to_str if name.respond_to?(:to_str) unless name.kind_of?(String) || name.nil? raise ArgumentError, "Expected a String or Symbol for a namespace name" end Rake.application.in_namespace(name, &block) end