Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8758

Show
Ignore:
Timestamp:
01/31/08 04:44:50 (5 months ago)
Author:
minam
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/capistrano/CHANGELOG

    r8755 r8758  
    11*SVN* 
     2 
     3* Fail gracefully when double-colons are used to delimit namespaces [richie] 
    24 
    35* Add support for :git_enable_submodules variable, to enable submodules with the git SCM [halorgium] 
  • tools/capistrano/lib/capistrano/configuration/namespaces.rb

    r7302 r8758  
    117117        ns = self 
    118118        until parts.empty? 
    119           ns = ns.namespaces[parts.shift.to_sym] 
     119          next_part = parts.shift 
     120          ns = next_part.empty? ? nil : ns.namespaces[next_part.to_sym] 
    120121          return nil if ns.nil? 
    121122        end 
  • tools/capistrano/test/configuration/namespace_dsl_test.rb

    r7302 r8758  
    295295    assert_equal @config, @config.namespaces[:outer].namespaces[:middle].namespaces[:inner].top 
    296296  end 
     297 
     298  def test_find_task_should_return_nil_when_empty_inner_task 
     299    @config.namespace :outer do 
     300      namespace :inner do 
     301      end 
     302    end 
     303    assert_nil @config.find_task("outer::inner") 
     304  end 
    297305end