Sha256: f94f30d98505bbce71543d440ffdb4adb101338c191ae751bd1f75c74cbd7352

Contents?: true

Size: 472 Bytes

Versions: 167

Compression:

Stored size: 472 Bytes

Contents

class String
  @@colorize = false

  class << self
    def colorize=(value)
      @@colorize = value
    end

    def colorize
      @@colorize
    end
  end # of class methods

  Term::ANSIColor::Attribute.named_attributes.map do |attribute|
    class_eval(<<-EOS, __FILE__, __LINE__ + 1)
      def #{attribute.name}
        if @@colorize
          Term::ANSIColor.send(#{attribute.name.inspect}, self)
        else
          self
        end
      end
    EOS
  end
end

Version data entries

167 entries across 167 versions & 11 rubygems

Version Path
lbrt-0.1.5 lib/lbrt/ext/string_ext.rb
lbrt-0.1.4 lib/lbrt/ext/string_ext.rb
lbrt-0.1.3 lib/lbrt/ext/string_ext.rb
lbrt-0.1.1 lib/lbrt/ext/string_ext.rb
barkdog-0.1.2 lib/barkdog/ext/string_ext.rb
lbrt-0.1.0 lib/lbrt/ext/string_ext.rb
gratan-0.2.9.beta2 lib/gratan/ext/string_ext.rb
radiosonde-0.0.7 lib/radiosonde/ext/string_ext.rb
gratan-0.2.9.beta lib/gratan/ext/string_ext.rb
barkdog-0.1.1 lib/barkdog/ext/string_ext.rb
miam-0.2.1 lib/miam/ext/string_ext.rb
barkdog-0.1.0 lib/barkdog/ext/string_ext.rb
barkdog-0.0.1 lib/barkdog/ext/string_ext.rb
gratan-0.2.8 lib/gratan/ext/string_ext.rb
miam-0.2.1.beta2 lib/miam/ext/string_ext.rb
miam-0.2.1.beta lib/miam/ext/string_ext.rb
gratan-0.2.8.beta3 lib/gratan/ext/string_ext.rb
gratan-0.2.8.beta2 lib/gratan/ext/string_ext.rb
gratan-0.2.8.beta lib/gratan/ext/string_ext.rb
miam-0.2.0 lib/miam/ext/string_ext.rb