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 uncolor String method to remove ANSI color codes #30

Merged
merged 4 commits into from
May 18, 2020

Conversation

duffyjp
Copy link
Contributor

@duffyjp duffyjp commented May 5, 2020

I added uncolor to String. It's the same name and code used in Rainbow.

I often find it handy to strip color codes from terminal output to use in emails etc where it's not interpreted.

Example:

2.6.5 :003 > "foo".red + "bar".blue
 => "\e[1;31mfoo\e[0m\e[1;34mbar\e[0m" 
2.6.5 :004 > ("foo".red + "bar".blue).uncolor
 => "foobar" 

@HarlemSquirrel
Copy link
Member

Hey there, thanks for the contribution! The failing spec should be fixed in master so could you please update your branch when you have a moment?

@HarlemSquirrel
Copy link
Member

@duffyjp Do you have a moment to update this branch from master?

Copy link
Member

@HarlemSquirrel HarlemSquirrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@HarlemSquirrel HarlemSquirrel merged commit 0e44d75 into amazing-print:master May 18, 2020
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.

2 participants