ruby-changes:3430
From: ko1@a...
Date: 7 Jan 2008 11:52:31 +0900
Subject: [ruby-changes:3430] drbrain - Ruby:r14923 (trunk): Merge documentation from the same class on ri generation.
drbrain 2008-01-07 11:52:15 +0900 (Mon, 07 Jan 2008)
New Revision: 14923
Modified files:
trunk/ChangeLog
trunk/lib/rdoc/generators/ri_generator.rb
trunk/lib/rdoc/options.rb
Log:
Merge documentation from the same class on ri generation.
Fixes bug where documentation could disappear.
Fix typo in lib/rdoc/options.rb
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14923&r2=14922&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rdoc/options.rb?r1=14923&r2=14922&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rdoc/generators/ri_generator.rb?r1=14923&r2=14922&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 14922)
+++ ChangeLog (revision 14923)
@@ -1,3 +1,14 @@
+Mon Jan 7 11:51:49 2008 Eric Hodel <drbrain@s...>
+
+ * lib/rdoc/generators/ri_generator.rb: Merge documentation from the
+ same class on output. Fixes bug where documentation could
+ disappear.
+
+ * lib/rdoc/options.rb: Fix typo.
+
+ * lib/rdoc/generators/*: Clean up some namespacing and make RDoc
+ consistent.
+
Mon Jan 7 11:44:45 2008 Tanaka Akira <akr@f...>
* encoding.c (rb_enc_internal_get_index): extracted from
Index: lib/rdoc/generators/ri_generator.rb
===================================================================
--- lib/rdoc/generators/ri_generator.rb (revision 14922)
+++ lib/rdoc/generators/ri_generator.rb (revision 14923)
@@ -28,6 +28,8 @@
@ri_writer = RI::RiWriter.new(".")
@markup = SM::SimpleMarkup.new
@to_flow = SM::ToFlow.new
+
+ @generated = {}
end
##
@@ -205,17 +207,21 @@
end
end
- if old_cls.nil?
- # no merge: simply overwrite
- @ri_writer.remove_class(cls_desc)
- @ri_writer.add_class(cls_desc)
- else
- # existing class: merge in
- old_desc = rdr.get_class(old_cls)
+ prev_cls = @generated[cls_desc.full_name]
- old_desc.merge_in(cls_desc)
- @ri_writer.add_class(old_desc)
+ if old_cls and not prev_cls then
+ old_desc = rdr.get_class old_cls
+ cls_desc.merge_in old_desc
end
+
+ if prev_cls then
+ cls_desc.merge_in prev_cls
+ end
+
+ @generated[cls_desc.full_name] = cls_desc
+
+ @ri_writer.remove_class cls_desc
+ @ri_writer.add_class cls_desc
end
end
Index: lib/rdoc/options.rb
===================================================================
--- lib/rdoc/options.rb (revision 14922)
+++ lib/rdoc/options.rb (revision 14923)
@@ -352,7 +352,7 @@
@op_name = nil
@show_all = false
@main_page = nil
- @marge = false
+ @merge = false
@exclude = []
@quiet = false
@generator_name = 'html'
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml