summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
commit287a34ae0dfc23e4158f67cb7783d239f202c368 (patch)
tree5e35d5b41aae961b37cf6632f60c42f51c7aa775 /lib/rdoc/ri
parent9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff)
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri')
-rw-r--r--lib/rdoc/ri/display.rb30
-rw-r--r--lib/rdoc/ri/driver.rb2
-rw-r--r--lib/rdoc/ri/formatter.rb2
-rw-r--r--lib/rdoc/ri/util.rb2
4 files changed, 18 insertions, 18 deletions
diff --git a/lib/rdoc/ri/display.rb b/lib/rdoc/ri/display.rb
index 7b0158c18a..f6b647fbc1 100644
--- a/lib/rdoc/ri/display.rb
+++ b/lib/rdoc/ri/display.rb
@@ -119,35 +119,35 @@ class RDoc::RI::DefaultDisplay
return display_class_method_list(klass)
end
end
-
+
##
# Given a Hash mapping a class' methods to method types (returned by
# display_class_method_list), this method allows the user to
# choose one of the methods.
-
+
def get_class_method_choice(method_map)
if CAN_USE_READLINE
# prepare abbreviations for tab completion
abbreviations = method_map.keys.abbrev
- Readline.completion_proc = proc do |string|
+ Readline.completion_proc = proc do |string|
abbreviations.values.uniq.grep(/^#{string}/)
end
end
-
+
@formatter.raw_print_line "\nEnter the method name you want.\n"
@formatter.raw_print_line "Class methods can be preceeded by '::' and instance methods by '#'.\n"
if CAN_USE_READLINE
@formatter.raw_print_line "You can use tab to autocomplete.\n"
@formatter.raw_print_line "Enter a blank line to exit.\n"
-
+
choice_string = Readline.readline(">> ").strip
else
@formatter.raw_print_line "Enter a blank line to exit.\n"
@formatter.raw_print_line ">> "
choice_string = $stdin.gets.strip
end
-
+
if choice_string == ''
return nil
else
@@ -172,7 +172,7 @@ class RDoc::RI::DefaultDisplay
end
end
end
-
+
##
# Display methods on +klass+
@@ -187,16 +187,16 @@ class RDoc::RI::DefaultDisplay
:instance_methods,
:instance_method_extensions,
]
-
+
class_data.each do |data_type|
data = klass.send data_type
-
+
unless data.nil? or data.empty? then
@formatter.blankline
-
+
heading = data_type.to_s.split('_').join(' ').capitalize << ':'
@formatter.display_heading heading, 2, ''
-
+
method_names = []
data.each do |item|
method_names << item.name
@@ -268,7 +268,7 @@ class RDoc::RI::DefaultDisplay
end
end
end
-
+
##
# Display a list of +methods+ and allow the user to select one of them.
@@ -280,9 +280,9 @@ class RDoc::RI::DefaultDisplay
methods.each_with_index do |method, index|
@formatter.raw_print_line "%3d %s [%s]\n" % [index + 1, method.full_name, method.source_path]
end
-
+
@formatter.raw_print_line ">> "
-
+
choice = $stdin.gets.strip!
if(choice == '')
@@ -294,7 +294,7 @@ class RDoc::RI::DefaultDisplay
if ((choice == 0) || (choice > methods.size)) then
@formatter.raw_print_line "Invalid choice!\n"
else
- method = methods[choice - 1]
+ method = methods[choice - 1]
display_method_info(method)
end
end
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index 0c91232b70..89534a5972 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -527,7 +527,7 @@ Options may also be set in the 'RI' environment variable.
ancestors = [orig_klass]
ancestors.push(*cache.includes.map { |inc| inc['name'] })
ancestors << cache.superclass
-
+
ancestor_index = ancestors.index(klass)
if ancestor_index
diff --git a/lib/rdoc/ri/formatter.rb b/lib/rdoc/ri/formatter.rb
index 933882abc4..258907d141 100644
--- a/lib/rdoc/ri/formatter.rb
+++ b/lib/rdoc/ri/formatter.rb
@@ -114,7 +114,7 @@ class RDoc::RI::Formatter
txt = txt.gsub(%r{<tt>(.*?)</tt>}, '+\1+')
txt.gsub!(%r{<code>(.*?)</code>}, '+\1+')
txt.gsub!(%r{<b>(.*?)</b>}, '*\1*')
- txt.gsub!(%r{<em>(.*?)</em>}, '_\1_')
+ txt.gsub!(%r{<em>(.*?)</em>}, '_\1_')
txt
end
diff --git a/lib/rdoc/ri/util.rb b/lib/rdoc/ri/util.rb
index 4e91eb978d..51cf881bdd 100644
--- a/lib/rdoc/ri/util.rb
+++ b/lib/rdoc/ri/util.rb
@@ -60,7 +60,7 @@ class RDoc::RI::NameDescriptor
end
if @method_name =~ /::|\.|#/ or !tokens.empty?
- raise RDoc::RI::Error.new("Bad argument: #{arg}")
+ raise RDoc::RI::Error.new("Bad argument: #{arg}")
end
if separator && separator != '.'
@is_class_method = separator == "::"