From d17cc7b45704091447bf2c20e5475a879bb74e24 Mon Sep 17 00:00:00 2001 From: Jim Weirich Date: Thu, 26 Aug 2010 07:55:04 -0400 Subject: [PATCH] Disable colorization when the NO_COLOR env variable is defined. --- src/edgecase.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/edgecase.rb b/src/edgecase.rb index 2718032..33cb889 100644 --- a/src/edgecase.rb +++ b/src/edgecase.rb @@ -53,7 +53,11 @@ module EdgeCase end def self.colorize(string, color_value) - color(color_value) + string + color(COLORS[:clear]) + if ENV['NO_COLOR'] + string + else + color(color_value) + string + color(COLORS[:clear]) + end end def self.color(color_value)