From d8c7695fbb2944aba9a69dce75f41b6881d1fc12 Mon Sep 17 00:00:00 2001 From: drbrain Date: Thu, 13 Dec 2012 07:58:47 +0000 Subject: * lib/rdoc/class_module.rb: Fixed duplicate comments for classes and modules from C. * test/rdoc/test_rdoc_class_module.rb: Test for the above. * lib/rdoc/parser/c.rb: Reload C variable names to allow proper updates of an ri store for C files. * lib/rdoc/rdoc.rb: ditto. * lib/rdoc/store.rb: ditto. * test/rdoc/test_rdoc_parser_c.rb: Test for the above. * test/rdoc/test_rdoc_store.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/class_module.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/rdoc/class_module.rb') diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb index a520503598..1dbe57bdf1 100644 --- a/lib/rdoc/class_module.rb +++ b/lib/rdoc/class_module.rb @@ -31,7 +31,7 @@ class RDoc::ClassModule < RDoc::Context ## # Comment and the location it came from. Use #add_comment to add comments - attr_reader :comment_location + attr_accessor :comment_location attr_accessor :diagram # :nodoc: @@ -134,6 +134,9 @@ class RDoc::ClassModule < RDoc::Context else normalize_comment comment end + + @comment_location.delete_if { |(_, l)| l == location } + @comment_location << [comment, location] self.comment = original -- cgit v1.2.3