summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/color.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index f6b9ed67e1..0f49291d85 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -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:)