Sha256: f558ac5876ca152f1c66403e790d68c5e884d45e6c29c7540cd8107142b51ec6

Contents?: true

Size: 315 Bytes

Versions: 4

Compression:

Stored size: 315 Bytes

Contents

class String

  def colorize(color_code) "\e[#{color_code}m#{self}\e[0m"; end

  def bold()   colorize('1'); end
  def invert() colorize('7'); end

  def red()   colorize('31'); end
  def blue()  colorize('34'); end
  def green() colorize('32'); end

  def undent() gsub(/^.{#{slice(/^ +/).length}}/, ''); end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
git-conform-1.3.0 lib/ext/string.rb
git-conform-1.2.1 lib/ext/string.rb
git-conform-1.1.0 lib/ext/string.rb
git-conform-1.0.0 lib/ext/string.rb