summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri/driver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/ri/driver.rb')
-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: