1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Symbol.all_symbols was adopted by Ruby 1.8.0 or later

71ba754e8e
This commit is contained in:
aycabta 2020-07-24 23:48:32 +09:00
parent 5474007d61
commit 6f0ef83de7

View file

@ -97,7 +97,6 @@ module IRB
when /^(:[^:.]*)$/ when /^(:[^:.]*)$/
# Symbol # Symbol
return nil if doc_namespace return nil if doc_namespace
if Symbol.respond_to?(:all_symbols)
sym = $1 sym = $1
candidates = Symbol.all_symbols.collect do |s| candidates = Symbol.all_symbols.collect do |s|
":" + s.id2name.encode(Encoding.default_external) ":" + s.id2name.encode(Encoding.default_external)
@ -105,9 +104,6 @@ module IRB
# ignore # ignore
end end
candidates.grep(/^#{Regexp.quote(sym)}/) candidates.grep(/^#{Regexp.quote(sym)}/)
else
[]
end
when /^::([A-Z][^:\.\(]*)$/ when /^::([A-Z][^:\.\(]*)$/
# Absolute Constant or class methods # Absolute Constant or class methods