diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-07 02:52:15 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-07 02:52:15 +0000 |
commit | d9d3e87a522ce180768aef2fcb32c236c68b07f2 (patch) | |
tree | 1d843e4b26e1f4b59757ce6980b9e61df7cdd887 /lib | |
parent | 063beac3436cb94bf51cb9fec08b34e977563faa (diff) | |
download | ruby-d9d3e87a522ce180768aef2fcb32c236c68b07f2.tar.gz |
Merge documentation from the same class on ri generation.
Fixes bug where documentation could disappear.
Fix typo in lib/rdoc/options.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/generators/ri_generator.rb | 24 | ||||
-rw-r--r-- | lib/rdoc/options.rb | 2 |
2 files changed, 16 insertions, 10 deletions
diff --git a/lib/rdoc/generators/ri_generator.rb b/lib/rdoc/generators/ri_generator.rb index b248909fa9..edca9938a5 100644 --- a/lib/rdoc/generators/ri_generator.rb +++ b/lib/rdoc/generators/ri_generator.rb @@ -28,6 +28,8 @@ class Generators::RIGenerator @ri_writer = RI::RiWriter.new(".") @markup = SM::SimpleMarkup.new @to_flow = SM::ToFlow.new + + @generated = {} end ## @@ -205,17 +207,21 @@ class Generators::RIGenerator 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] + + if old_cls and not prev_cls then + old_desc = rdr.get_class old_cls + cls_desc.merge_in old_desc + end - old_desc.merge_in(cls_desc) - @ri_writer.add_class(old_desc) + 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 diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 259fef487b..0b12efe9be 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -352,7 +352,7 @@ class Options @op_name = nil @show_all = false @main_page = nil - @marge = false + @merge = false @exclude = [] @quiet = false @generator_name = 'html' |