mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/irb] Directly check if the method is available instead of version
https://github.com/ruby/irb/commit/3ea9fd9ed0
This commit is contained in:
parent
6aa786b8a3
commit
0fcbd07247
1 changed files with 1 additions and 2 deletions
|
@ -146,10 +146,9 @@ module IRB # :nodoc:
|
|||
seen.delete(obj)
|
||||
end
|
||||
|
||||
# Ripper::Lexer::Elem#state is supported on Ruby 2.5+
|
||||
def supported?
|
||||
return @supported if defined?(@supported)
|
||||
@supported = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.5.0')
|
||||
@supported = Ripper::Lexer::Elem.method_defined?(:state)
|
||||
end
|
||||
|
||||
def scan(code, allow_last_error:)
|
||||
|
|
Loading…
Reference in a new issue