1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Fail gracefully when double-colons are used to delimit namespaces (closes #10472)

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@8758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2008-01-31 04:44:50 +00:00
parent b4a0d3c30a
commit a7a256956d
3 changed files with 12 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Fail gracefully when double-colons are used to delimit namespaces [richie]
* Add support for :git_enable_submodules variable, to enable submodules with the git SCM [halorgium]
* If subversion asks for a password, prompt as a last resort [Jamis Buck]

View file

@ -116,7 +116,8 @@ module Capistrano
ns = self
until parts.empty?
ns = ns.namespaces[parts.shift.to_sym]
next_part = parts.shift
ns = next_part.empty? ? nil : ns.namespaces[next_part.to_sym]
return nil if ns.nil?
end

View file

@ -294,4 +294,12 @@ class ConfigurationNamespacesDSLTest < Test::Unit::TestCase
@config.namespace(:outer) { namespace(:middle) { namespace(:inner) {} } }
assert_equal @config, @config.namespaces[:outer].namespaces[:middle].namespaces[:inner].top
end
def test_find_task_should_return_nil_when_empty_inner_task
@config.namespace :outer do
namespace :inner do
end
end
assert_nil @config.find_task("outer::inner")
end
end