mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
[ruby/irb] Let IRB::Color.colorable? always return true|false
(https://github.com/ruby/irb/pull/940)
0bbe435ffe
This commit is contained in:
parent
1000c27db8
commit
77f5301cd1
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue