From 3816157e5d955da422d717f278bd3d4551447348 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 7 Apr 2021 12:07:48 +0900 Subject: [PATCH] [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 --- lib/irb/color.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/irb/color.rb b/lib/irb/color.rb index cfbb3cc668..fce4d53191 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -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]