summaryrefslogtreecommitdiff
path: root/lib/irb/init.rb
diff options
context:
space:
mode:
authorMark Delk <[email protected]>2020-05-17 20:12:02 -0500
committergit <[email protected]>2021-05-24 11:55:58 +0900
commitb8ffb1c46f03dacfdb6b4417274ca66cc9142e5b (patch)
treed51e44757f8ee11177bc132b7538768b501f46c2 /lib/irb/init.rb
parente16a642900b17c18e014360370b4a5eb0897605d (diff)
[ruby/irb] respect NO_COLOR environment variable
When `NO_COLOR` is set to any non-nil value, output is not colorized. See https://no-color.org/ https://github.com/ruby/irb/commit/401d0916fe
Diffstat (limited to 'lib/irb/init.rb')
-rw-r--r--lib/irb/init.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index 78ef2fa3c1..3a5f3de26c 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -44,7 +44,7 @@ module IRB # :nodoc:
@CONF[:IRB_RC] = nil
@CONF[:USE_SINGLELINE] = false unless defined?(ReadlineInputMethod)
- @CONF[:USE_COLORIZE] = true
+ @CONF[:USE_COLORIZE] = !ENV['NO_COLOR']
@CONF[:INSPECT_MODE] = true
@CONF[:USE_TRACER] = false
@CONF[:USE_LOADER] = false
@@ -301,11 +301,11 @@ module IRB # :nodoc:
break
end
end
+
load_path.collect! do |path|
/\A\.\// =~ path ? path : File.expand_path(path)
end
$LOAD_PATH.unshift(*load_path)
-
end
# running config