summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2024-05-01 23:52:49 +0900
committergit <svn-admin@ruby-lang.org>2024-05-01 14:52:53 +0000
commit77f5301cd16f873bca8c09cb37223b659100c499 (patch)
treefedc82971520accf9bb7cb5d112fc66645dea136 /lib
parent1000c27db861a4c405dcea12be391df031a14fdc (diff)
[ruby/irb] Let IRB::Color.colorable? always return true|false
(https://github.com/ruby/irb/pull/940) https://github.com/ruby/irb/commit/0bbe435ffe
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/color.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index ad8670160c..fca942b28b 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -79,12 +79,12 @@ module IRB # :nodoc:
class << self
def colorable?
- supported = $stdout.tty? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
+ supported = $stdout.tty? && (/mswin|mingw/.match?(RUBY_PLATFORM) || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
# because ruby/debug also uses irb's color module selectively,
# irb won't be activated in that case.
if IRB.respond_to?(:conf)
- supported && IRB.conf.fetch(:USE_COLORIZE, true)
+ supported && !!IRB.conf.fetch(:USE_COLORIZE, true)
else
supported
end