Skip to content

Commit ac496d4

Browse files
committed
Ripper::Lexer::Elem#state is defined since Ruby 2.5
And the required ruby version is 2.5 or later.
1 parent f6a6d0f commit ac496d4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/irb/color.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module Color
7777

7878
class << self
7979
def colorable?
80-
$stdout.tty? && supported? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
80+
$stdout.tty? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
8181
end
8282

8383
def inspect_colorable?(obj, seen: {}.compare_by_identity)
@@ -161,11 +161,6 @@ def without_circular_ref(obj, seen:, &block)
161161
seen.delete(obj)
162162
end
163163

164-
def supported?
165-
return @supported if defined?(@supported)
166-
@supported = Ripper::Lexer::Elem.method_defined?(:state)
167-
end
168-
169164
def scan(code, allow_last_error:)
170165
pos = [1, 0]
171166

0 commit comments

Comments
 (0)