[ruby/irb] Ripper::Lexer::Elem#state is defined since Ruby 2.5

And the required ruby version is 2.5 or later.

https://github.com/ruby/irb/commit/ac496d4c78
This commit is contained in:
Nobuyoshi Nakada 2021-04-07 12:07:48 +09:00 committed by git
parent d825e34962
commit 3816157e5d
1 changed files with 1 additions and 6 deletions

View File

@ -77,7 +77,7 @@ module IRB # :nodoc:
class << self
def colorable?
$stdout.tty? && supported? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
$stdout.tty? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
end
def inspect_colorable?(obj, seen: {}.compare_by_identity)
@ -161,11 +161,6 @@ module IRB # :nodoc:
seen.delete(obj)
end
def supported?
return @supported if defined?(@supported)
@supported = Ripper::Lexer::Elem.method_defined?(:state)
end
def scan(code, allow_last_error:)
pos = [1, 0]