1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Class instance should be also colorable on IRB

inspect.

Change is made with: `$ make -C .ruby sync-default-gems GEM=irb`
This commit is contained in:
Takashi Kokubun 2019-04-26 18:42:50 +09:00
parent 52cfb17086
commit 6669c966d2
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD
2 changed files with 2 additions and 1 deletions

View file

@ -51,7 +51,7 @@ module IRB # :nodoc:
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

View file

@ -53,6 +53,7 @@ module TestIRB
['foo', :bar] => true,
{ a: 4 } => true,
/reg/ => true,
Struct => true,
Object.new => false,
Struct.new(:a) => false,
Struct.new(:a).new(1) => false,