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
dyna-0.2.3 lib/dyna/ext/string-ext.rb
dyna-0.2.2 lib/dyna/ext/string-ext.rb
dyna-0.2.1 lib/dyna/ext/string-ext.rb
miam-0.2.5.beta1 lib/miam/ext/string_ext.rb
gratan-0.3.2 lib/gratan/ext/string_ext.rb
miam-0.2.4 lib/miam/ext/string_ext.rb
dyna-0.2.1.beta2 lib/dyna/ext/string-ext.rb
dyna-0.2.1.beta1 lib/dyna/ext/string-ext.rb
dyna-0.2.0 lib/dyna/ext/string-ext.rb
gratan-0.3.1 lib/gratan/ext/string_ext.rb
gratan-0.3.1.beta4 lib/gratan/ext/string_ext.rb
gratan-0.3.1.beta3 lib/gratan/ext/string_ext.rb
miam-0.2.4.beta18 lib/miam/ext/string_ext.rb
miam-0.2.4.beta17 lib/miam/ext/string_ext.rb
radiosonde-0.2.0.beta5 lib/radiosonde/ext/string_ext.rb
miam-0.2.4.beta16 lib/miam/ext/string_ext.rb
posgra-0.2.3.beta lib/posgra/ext/string_ext.rb
miam-0.2.4.beta15 lib/miam/ext/string_ext.rb
radiosonde-0.2.0.beta4 lib/radiosonde/ext/string_ext.rb
miam-0.2.4.beta14 lib/miam/ext/string_ext.rb