summaryrefslogtreecommitdiff
path: root/lib/irb/completion.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-09-16 11:19:17 +0900
committernagachika <nagachika@ruby-lang.org>2020-09-16 21:08:31 +0900
commit2159798f4c0f71007db733cddd82b99186c8e424 (patch)
tree4e79977d4c6cbc84221d06adad3acfb4234cc911 /lib/irb/completion.rb
parent3bb503e0e8f92c039ce50f430b14649a36c03feb (diff)
Merge IRB 1.2.6
Diffstat (limited to 'lib/irb/completion.rb')
-rw-r--r--lib/irb/completion.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index c44aa9039e..c9328e5c5a 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -7,7 +7,6 @@
# From Original Idea of shugo@ruby-lang.org
#
-require "readline"
autoload :RDoc, "rdoc"
module IRB
@@ -97,17 +96,13 @@ module IRB
when /^(:[^:.]*)$/
# Symbol
return nil if doc_namespace
- if Symbol.respond_to?(:all_symbols)
- sym = $1
- candidates = Symbol.all_symbols.collect do |s|
- ":" + s.id2name.encode(Encoding.default_external)
- rescue Encoding::UndefinedConversionError
- # ignore
- end
- candidates.grep(/^#{Regexp.quote(sym)}/)
- else
- []
+ sym = $1
+ candidates = Symbol.all_symbols.collect do |s|
+ ":" + s.id2name.encode(Encoding.default_external)
+ rescue Encoding::UndefinedConversionError
+ # ignore
end
+ candidates.grep(/^#{Regexp.quote(sym)}/)
when /^::([A-Z][^:\.\(]*)$/
# Absolute Constant or class methods