Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to force color output #9

Closed
wants to merge 3 commits into from

Conversation

moretea
Copy link

@moretea moretea commented Mar 24, 2013

The current version of colorize does not print any output when STDOUT is a tty.
This pull requests makes that behavior configurable.

STDOUT.isatty #=> false
"str".blue #=> not colored

String.force_color!
"str".blue # => colored
"str".red # => colored
STDOUT.isatty #=> false
"str".blue #=> not colored

String.force_color!
"str".blue # => colored
String.force_color!(false)
"str".red # => NOT colored
STDOUT.isatty #=> false
"str".blue #=> not colored

String.force_color! do
   "str".blue # => colored
end
"str".red # => NOT colored

@fazibear
Copy link
Owner

STDOUT.isatty was removed by other pull request.

@fazibear fazibear closed this Sep 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants