summaryrefslogtreecommitdiff
path: root/bin/ri
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-24 04:24:29 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-24 04:24:29 +0000
commitf0346bd249ae29cdf4d9c2e88b09e63c41ff1ce8 (patch)
treec945829da8f2e7555a6b4cb7e11601dfafdc4d78 /bin/ri
parent52975bb7a77b3a6409e50609b4baeafade035b3d (diff)
Forgot to save buffer.... sigh
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bin/ri')
-rwxr-xr-xbin/ri21
1 files changed, 11 insertions, 10 deletions
diff --git a/bin/ri b/bin/ri
index 07f7bc3..4567c66 100755
--- a/bin/ri
+++ b/bin/ri
@@ -23,11 +23,12 @@ require 'rdoc/ri/ri_options'
######################################################################
def display_usage
- File.open(__FILE__) do |f|
- f.gets
- puts $1 while (f.gets =~ /^# ?(.*)/)
- end
- exit
+ RI::Options::OptionList.usage(short_form=true)
+# File.open(__FILE__) do |f|
+# f.gets
+# puts $1 while (f.gets =~ /^# ?(.*)/)
+# end
+# exit
end
@@ -48,7 +49,7 @@ class RiDisplay
exit 1
end
@ri_reader = RI::RiReader.new(RI::RiCache.new(paths))
- @formatter = RI::TextFormatter.create(@options, " ")
+ @formatter = @options.formatter.new(@options, " ")
end
@@ -133,7 +134,7 @@ def display_class_info(class_entry)
unless klass.includes.empty?
@formatter.blankline
- @formatter.wrap("Includes:", "")
+ @formatter.display_heading("Includes:", 2, "")
incs = []
klass.includes.each do |inc|
inc_desc = @ri_reader.find_class_by_name(inc.name)
@@ -151,7 +152,7 @@ def display_class_info(class_entry)
unless klass.constants.empty?
@formatter.blankline
- @formatter.wrap("Constants:", "")
+ @formatter.display_heading("Constants:", 2, "")
len = 0
klass.constants.each { |c| len = c.name.length if c.name.length > len }
len += 2
@@ -163,13 +164,13 @@ def display_class_info(class_entry)
unless klass.class_methods.empty?
@formatter.blankline
- @formatter.wrap("Class methods:", "")
+ @formatter.display_heading("Class methods:", 2, "")
@formatter.wrap(klass.class_methods.map{|m| m.name}.sort.join(', '))
end
unless klass.instance_methods.empty?
@formatter.blankline
- @formatter.wrap("Instance methods:", "")
+ @formatter.display_heading("Instance methods:", 2, "")
@formatter.wrap(klass.instance_methods.map{|m| m.name}.sort.join(', '))
end