summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-26 05:56:26 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-26 05:56:26 +0000
commit98c7058bf7b3eab91c62a77cb10b09f6c8ed368e (patch)
treea90e594c950a1e3160a69f90a9e6215242937ef7 /lib/rdoc/ri
parentee83dc3fe49ac23321a055a2a4b337499d2494eb (diff)
Merge RDoc 6.0.3 from upstream.
It fixed the several bugs that was found after RDoc 6 releasing. From: SHIBATA Hiroshi <hsbt@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri')
-rw-r--r--lib/rdoc/ri/driver.rb35
1 files changed, 28 insertions, 7 deletions
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index fa0e040a42..c4d1dd03df 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -110,7 +110,7 @@ class RDoc::RI::Driver
def self.dump data_path
require 'pp'
- open data_path, 'rb' do |io|
+ File.open data_path, 'rb' do |io|
pp Marshal.load(io.read)
end
end
@@ -425,6 +425,7 @@ or the PAGER environment variable.
@server = options[:server]
@use_stdout = options[:use_stdout]
@show_all = options[:show_all]
+ @width = options[:width]
# pager process for jruby
@jruby_pager_process = nil
@@ -795,7 +796,9 @@ or the PAGER environment variable.
def display document
page do |io|
- text = document.accept formatter(io)
+ f = formatter(io)
+ f.width = @width if @width and f.respond_to?(:width)
+ text = document.accept f
io.write text
end
@@ -1440,7 +1443,13 @@ or the PAGER environment variable.
render_method_arguments out, method.arglists
render_method_superclass out, method
- render_method_comment out, method
+ if method.is_alias_for
+ al = method.is_alias_for
+ alias_for = store.load_method al.parent_name, "#{al.name_prefix}#{al.name}"
+ render_method_comment out, method, alias_for
+ else
+ render_method_comment out, method
+ end
end
def render_method_arguments out, arglists # :nodoc:
@@ -1452,10 +1461,22 @@ or the PAGER environment variable.
out << RDoc::Markup::Rule.new(1)
end
- def render_method_comment out, method # :nodoc:
- out << RDoc::Markup::BlankLine.new
- out << method.comment
- out << RDoc::Markup::BlankLine.new
+ def render_method_comment out, method, alias_for = nil# :nodoc:
+ if alias_for
+ unless method.comment.nil? or method.comment.empty?
+ out << RDoc::Markup::BlankLine.new
+ out << method.comment
+ end
+ out << RDoc::Markup::BlankLine.new
+ out << RDoc::Markup::Paragraph.new("(this method is alias for #{alias_for.full_name})")
+ out << RDoc::Markup::BlankLine.new
+ out << alias_for.comment
+ out << RDoc::Markup::BlankLine.new
+ else
+ out << RDoc::Markup::BlankLine.new
+ out << method.comment
+ out << RDoc::Markup::BlankLine.new
+ end
end
def render_method_superclass out, method # :nodoc: