summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-18 07:39:15 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-18 07:39:15 +0000
commit69dfd5e034188e20bc12c8a5dcb62694f52295a7 (patch)
tree711cd04b647c92c8cd493a814f019c0d7313d69a
parent2e881bd59e12cb33e868be93af34cb1e2d5475d1 (diff)
* lib/rdoc/store.rb: Work around RDoc stores from older versions of
RDoc. * test/rdoc/test_rdoc_store.rb: Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/rdoc/store.rb3
-rw-r--r--test/rdoc/test_rdoc_store.rb12
3 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2332c997..7eda2e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Dec 18 16:38:51 2012 Eric Hodel <drbrain@segment7.net>
+
+ * 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@segment7.net>
* lib/rdoc/ruby_lex.rb: Return a TkHEREDOC instead of a TkSTRING when
diff --git a/lib/rdoc/store.rb b/lib/rdoc/store.rb
index 2a2acf4..4975c6a 100644
--- a/lib/rdoc/store.rb
+++ b/lib/rdoc/store.rb
@@ -354,6 +354,9 @@ class RDoc::Store
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
diff --git a/test/rdoc/test_rdoc_store.rb b/test/rdoc/test_rdoc_store.rb
index 3b4f7cf..7e18693 100644
--- a/test/rdoc/test_rdoc_store.rb
+++ b/test/rdoc/test_rdoc_store.rb
@@ -274,6 +274,18 @@ class TestRDocStore < XrefTestCase
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')