module Cucumber::Term::ANSIColor
def self.coloring=(val)
this for example:
Turns the coloring on or off globally, so you can easily do
def self.coloring=(val) @coloring = val end
def self.coloring?
Returns true, if the coloring function of this module
def self.coloring? @coloring end
def self.included(klass)
def self.included(klass) if version_is_greater_than_18? and klass == String ATTRIBUTES.delete(:clear) ATTRIBUTE_NAMES.delete(:clear) end end
def attributes
def attributes ATTRIBUTE_NAMES end
def uncolored(string = nil) # :yields:
ANSI-sequences are stripped from the string.
Returns an uncolored version of the string, that is all
def uncolored(string = nil) # :yields: if block_given? yield.gsub(COLORED_REGEXP, '') elsif string string.gsub(COLORED_REGEXP, '') elsif respond_to?(:to_str) to_str.gsub(COLORED_REGEXP, '') else '' end end
def version_is_greater_than_18?
def version_is_greater_than_18? version = RUBY_VERSION.split('.') version.map! &:to_i version[0] >= 1 && version[1] > 8 end