diff --git a/lib/rdoc.rb b/lib/rdoc.rb index 21b037adee..a4288679c0 100644 --- a/lib/rdoc.rb +++ b/lib/rdoc.rb @@ -65,7 +65,7 @@ module RDoc ## # RDoc version you are using - VERSION = '6.0.3' + VERSION = '6.0.4' ## # Method visibilities diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index 6fe4a89e46..a90622f0f3 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -363,6 +363,7 @@ class RDoc::Parser::Ruby < RDoc::Parser container ||= if ignore_constants then c = RDoc::NormalModule.new name_t[:text] + c.store = @store new_modules << [prev_container, c] c else diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb index ce2aaae981..eb9c6b2455 100644 --- a/test/rdoc/test_rdoc_parser_ruby.rb +++ b/test/rdoc/test_rdoc_parser_ruby.rb @@ -3990,65 +3990,6 @@ module A Aliased = ::B::C::Defined end -module B - module C - class Defined - end - end -end - CLASS - - @parser.scan - - a = @top_level.modules.first - assert_equal 'A', a.full_name - assert_empty a.classes - assert_empty a.modules - assert_equal ['A::Aliased'], a.constants.map(&:full_name) - - defined = @store.find_class_named 'B::C::Defined' - assert_equal 'B::C::Defined', defined.full_name - - aliased = @store.find_class_named 'B::C::Aliased' - assert_equal 'B::C::Aliased', aliased.full_name - - visible = @store.all_modules.reject { |mod| mod.suppressed? } - visible = visible.map { |mod| mod.full_name } - - assert_equal ['A', 'B', 'B::C'], visible - end - - def test_parse_const_alias_defined_elsewhere - util_parser <<-CLASS -module A - Aliased = Defined -end - -module A - class Defined - end -end - CLASS - - @parser.scan - - a = @top_level.modules.first - assert_equal 'A', a.full_name - aliased = a.constants.first - assert_equal 'A::Aliased', aliased.full_name - - visible = @store.all_modules.reject { |mod| mod.suppressed? } - visible = visible.map { |mod| mod.full_name } - - assert_equal ['A'], visible - end - - def test_parse_const_alias_defined_far_away - util_parser <<-CLASS -module A - Aliased = ::B::C::Defined -end - module B module C class Defined