Created
February 22, 2018 09:09
-
-
Save EugenMayer/b97a008b6422102f6e1937368794c7a8 to your computer and use it in GitHub Desktop.
Pathes Ruby thor to support the NO_COLOR env variable to stop using colors e.g. when you want to parse logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Thor | |
module Shell | |
class Color | |
def can_display_colors? | |
return false unless ENV['NO_COLOR'].nil? | |
stdout.tty? | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment