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
miam-0.2.4.beta2 lib/miam/ext/string_ext.rb
miam-0.2.4.beta lib/miam/ext/string_ext.rb
miam-0.2.3 lib/miam/ext/string_ext.rb
eipmap-0.1.4 lib/eipmap/ext/string_ext.rb
radiosonde-0.1.0 lib/radiosonde/ext/string_ext.rb
miam-0.2.3.beta3 lib/miam/ext/string_ext.rb
miam-0.2.3.beta2 lib/miam/ext/string_ext.rb
posgra-0.2.1 lib/posgra/ext/string_ext.rb
posgra-0.2.0 lib/posgra/ext/string_ext.rb
posgra-0.1.9 lib/posgra/ext/string_ext.rb
posgra-0.1.8 lib/posgra/ext/string_ext.rb
posgra-0.1.7 lib/posgra/ext/string_ext.rb
posgra-0.1.6 lib/posgra/ext/string_ext.rb
posgra-0.1.5 lib/posgra/ext/string_ext.rb
posgra-0.1.4 lib/posgra/ext/string_ext.rb
posgra-0.1.3 lib/posgra/ext/string_ext.rb
posgra-0.1.2 lib/posgra/ext/string_ext.rb
posgra-0.1.1 lib/posgra/ext/string_ext.rb
posgra-0.1.0 lib/posgra/ext/string_ext.rb
miam-0.2.3.beta lib/miam/ext/string_ext.rb