0.0
No commit activity in last 3 years
No release in over 3 years
Toggles methods from colored gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

= 1.2
 Project Readme

colored-not

Colored... NOT!

Toggles methods from colored gem.

Installation

gem install colored-not

Scenario

colored gem will add a bunch of coloring methods to String class.

require 'colored'
"Roses are red".red                   # Returns "\e[31mRoses are red\e[0m"

OK, but what if we want to dynamically turn off colored output, without removing calls to those methods scattered all over the code? Colored.not! will replace the added methods with String#dups.

require 'colored/not'
Colored.not!
"Roses are red... not!".red           # Returns "Roses are red... not!"

We can re-enable the colors.

Colored!
"Roses are red again".red             # Returns "\e[31mRoses are red again\e[0m"