ruby-changes:26393
From: drbrain <ko1@a...>
Date: Tue, 18 Dec 2012 16:39:24 +0900 (JST)
Subject: [ruby-changes:26393] drbrain:r38444 (trunk): * lib/rdoc/store.rb: Work around RDoc stores from older versions of
drbrain 2012-12-18 16:39:15 +0900 (Tue, 18 Dec 2012) New Revision: 38444 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38444 Log: * lib/rdoc/store.rb: Work around RDoc stores from older versions of RDoc. * test/rdoc/test_rdoc_store.rb: Test for above. Modified files: trunk/ChangeLog trunk/lib/rdoc/store.rb trunk/test/rdoc/test_rdoc_store.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 38443) +++ ChangeLog (revision 38444) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Dec 18 16:38:51 2012 Eric Hodel <drbrain@s...> + + * lib/rdoc/store.rb: Work around RDoc stores from older versions of + RDoc. + * test/rdoc/test_rdoc_store.rb: Test for above. + Tue Dec 18 16:31:20 2012 Eric Hodel <drbrain@s...> * lib/rdoc/ruby_lex.rb: Return a TkHEREDOC instead of a TkSTRING when Index: lib/rdoc/store.rb =================================================================== --- lib/rdoc/store.rb (revision 38443) +++ lib/rdoc/store.rb (revision 38444) @@ -354,6 +354,9 @@ class RDoc::Store https://github.com/ruby/ruby/blob/trunk/lib/rdoc/store.rb#L354 loaded_mod = load_class_data name file = loaded_mod.in_files.first + + return unless file # legacy data source + file.store = self mod = file.add_module RDoc::NormalModule, name Index: test/rdoc/test_rdoc_store.rb =================================================================== --- test/rdoc/test_rdoc_store.rb (revision 38443) +++ test/rdoc/test_rdoc_store.rb (revision 38444) @@ -274,6 +274,18 @@ class TestRDocStore < XrefTestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_store.rb#L274 assert_includes @s.c_enclosure_classes, 'cObject' end + def test_find_c_enclosure_from_cache_legacy + @klass.in_files.clear + @s.save_class @klass + @s.classes_hash.clear + + assert_nil @s.find_c_enclosure 'cObject' + + @s.c_enclosure_names['cObject'] = 'Object' + + assert_nil @s.find_c_enclosure('cObject') + end + def test_find_class_named assert_equal @c1, @store.find_class_named('C1') -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/