Sha256: c010a16daf4cc60a4c6040d8dc45f8d26985ec284cacafe95b70f14fb49cb602

Contents?: true

Size: 400 Bytes

Versions: 4

Compression:

Stored size: 400 Bytes

Contents

class String
  # rubocop:disable Style/SingleLineMethods
  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
  # rubocop:enable Style/SingleLineMethods
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
git-multi-8.0.1 lib/ext/string.rb
git-multi-8.0.0 lib/ext/string.rb
git-multi-7.0.0 lib/ext/string.rb
git-multi-6.0.0 lib/ext/string.rb