summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/irb/completion.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index c44aa9039e..0d5420bc75 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -97,17 +97,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