Sha256: 4fdef5570114aca76a8dafc9ee00d6a929a4710a2b7790cd99afdacc844f2689

Contents?: true

Size: 408 Bytes

Versions: 25

Compression:

Stored size: 408 Bytes

Contents

# rubocop:disable Layout/EmptyLineBetweenDefs

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

# rubocop:enable Layout/EmptyLineBetweenDefs

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
git-multi-1.0.10 lib/ext/string.rb
git-multi-1.0.9 lib/ext/string.rb
git-multi-1.0.8 lib/ext/string.rb
git-multi-1.0.7 lib/ext/string.rb
git-multi-1.0.6 lib/ext/string.rb