Skip to content

Commit 0bbe435

Browse files
authored
Let IRB::Color.colorable? always return true|false (#940)
1 parent c55474f commit 0bbe435

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/irb/color.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ module Color
7979

8080
class << self
8181
def colorable?
82-
supported = $stdout.tty? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
82+
supported = $stdout.tty? && (/mswin|mingw/.match?(RUBY_PLATFORM) || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
8383

8484
# because ruby/debug also uses irb's color module selectively,
8585
# irb won't be activated in that case.
8686
if IRB.respond_to?(:conf)
87-
supported && IRB.conf.fetch(:USE_COLORIZE, true)
87+
supported && !!IRB.conf.fetch(:USE_COLORIZE, true)
8888
else
8989
supported
9090
end

0 commit comments

Comments
 (0)