njonsson/cape — Issue #2: Support Rake tasks whose names shadow namespaces
Author: njonsson
Created: 2012-01-30 15:27:59+00:00
State: open

Assume the following _Rakefile_.

desc 'Does foo'
task :foo do
puts 'Doing foo'
end

namespace :foo do
desc 'Does bar'
task :bar do
puts 'Doing bar'
end
end

Assume also the following Cape statements in _config/deploy.rb_.

Cape do
mirror_rake_tasks :foo
end

The following Capistrano exception occurs.

> _path/to/capistrano_/lib/capistrano/configuration/namespaces.rb:72:in `namespace': defining a namespace named `unsupported_license_data' would shadow an existing task with that name (ArgumentError)

This occurs because Cape attempts to define a namespace _:foo_ when a recipe _:foo_ is defined already.