ruby-changes:55543
From: Takashi <ko1@a...>
Date: Fri, 26 Apr 2019 18:43:33 +0900 (JST)
Subject: [ruby-changes:55543] Takashi Kokubun:6669c966d2 (trunk): Class instance should be also colorable on IRB
https://git.ruby-lang.org/ruby.git/commit/?id=6669c966d2 From 6669c966d2744f21315047d1725ad4494d15b8ba Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Fri, 26 Apr 2019 18:42:50 +0900 Subject: Class instance should be also colorable on IRB inspect. Change is made with: `$ make -C .ruby sync-default-gems GEM=irb` diff --git a/lib/irb/color.rb b/lib/irb/color.rb index 2e7a3e8..29d414e 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -51,7 +51,7 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L51 obj.all? { |k, v| inspect_colorable?(k) && inspect_colorable?(v) } when Array obj.all? { |o| inspect_colorable?(o) } - when String, Symbol, Regexp, Integer, Float, FalseClass, TrueClass, NilClass + when String, Symbol, Regexp, Integer, Float, FalseClass, TrueClass, NilClass, Class true else false diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index 8439fd5..61911cf 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -53,6 +53,7 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L53 ['foo', :bar] => true, { a: 4 } => true, /reg/ => true, + Struct => true, Object.new => false, Struct.new(:a) => false, Struct.new(:a).new(1) => false, -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/