From 84ece951630c61eddab8be47b80fc1a7f774175f Mon Sep 17 00:00:00 2001 From: drbrain Date: Tue, 28 Jun 2011 02:28:25 +0000 Subject: * lib/rdoc: Update to RDoc 3.7 (final) * NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/markup/document.rb | 11 +++++++++-- lib/rdoc/markup/inline.rb | 9 ++++++++- lib/rdoc/markup/to_ansi.rb | 6 +++--- 3 files changed, 20 insertions(+), 6 deletions(-) (limited to 'lib/rdoc/markup') diff --git a/lib/rdoc/markup/document.rb b/lib/rdoc/markup/document.rb index b4e070285e..6fbef33ae3 100644 --- a/lib/rdoc/markup/document.rb +++ b/lib/rdoc/markup/document.rb @@ -56,7 +56,12 @@ class RDoc::Markup::Document visitor.start_accepting @parts.each do |item| - item.accept visitor + case item + when RDoc::Markup::Document then # HACK + visitor.accept_document item + else + item.accept visitor + end end visitor.end_accepting @@ -66,7 +71,9 @@ class RDoc::Markup::Document # Does this document have no parts? def empty? - @parts.empty? + @parts.empty? or + (@parts.length == 1 and RDoc::Markup::Document === @parts.first and + @parts.first.empty?) end ## diff --git a/lib/rdoc/markup/inline.rb b/lib/rdoc/markup/inline.rb index 932ed536b7..cf598d1583 100644 --- a/lib/rdoc/markup/inline.rb +++ b/lib/rdoc/markup/inline.rb @@ -60,7 +60,14 @@ class RDoc::Markup class AttrChanger def to_s # :nodoc: - "Attr: +#{Attribute.as_string turn_on}/-#{Attribute.as_string turn_on}" + "Attr: +#{Attribute.as_string turn_on}/-#{Attribute.as_string turn_off}" + end + + def inspect # :nodoc: + "+%s/-%s" % [ + Attribute.as_string(turn_on), + Attribute.as_string(turn_off), + ] end end diff --git a/lib/rdoc/markup/to_ansi.rb b/lib/rdoc/markup/to_ansi.rb index 108a038075..1e8a0289d9 100644 --- a/lib/rdoc/markup/to_ansi.rb +++ b/lib/rdoc/markup/to_ansi.rb @@ -12,9 +12,9 @@ class RDoc::Markup::ToAnsi < RDoc::Markup::ToRdoc super @headings.clear - @headings[1] = ["\e[1;32m", "\e[m"] - @headings[2] = ["\e[4;32m", "\e[m"] - @headings[3] = ["\e[32m", "\e[m"] + @headings[1] = ["\e[1;32m", "\e[m"] # bold + @headings[2] = ["\e[4;32m", "\e[m"] # underline + @headings[3] = ["\e[32m", "\e[m"] # just green end ## -- cgit v1.2.3