[前][次][番号順一覧][スレッド一覧]

ruby-changes:65817

From: Nobuyoshi <ko1@a...>
Date: Thu, 8 Apr 2021 20:42:25 +0900 (JST)
Subject: [ruby-changes:65817] 3816157e5d (master): [ruby/irb] Ripper::Lexer::Elem#state is defined since Ruby 2.5

https://git.ruby-lang.org/ruby.git/commit/?id=3816157e5d

From 3816157e5d955da422d717f278bd3d4551447348 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 7 Apr 2021 12:07:48 +0900
Subject: [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 cfbb3cc..fce4d53 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -77,7 +77,7 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L77
 
     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: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L161
         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]
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]