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-4.0.1 lib/ext/string.rb
git-multi-4.0.0 lib/ext/string.rb
git-multi-3.0.3 lib/ext/string.rb
git-multi-3.0.2 lib/ext/string.rb
git-multi-3.0.0 lib/ext/string.rb
git-multi-2.10.0 lib/ext/string.rb
git-multi-2.9.0 lib/ext/string.rb
git-multi-2.8.0 lib/ext/string.rb
git-multi-2.7.0 lib/ext/string.rb
git-multi-2.6.1 lib/ext/string.rb
git-multi-2.6.0 lib/ext/string.rb
git-multi-2.5.0 lib/ext/string.rb
git-multi-2.4.0 lib/ext/string.rb
git-multi-2.3.0 lib/ext/string.rb
git-multi-2.2.0 lib/ext/string.rb
git-multi-2.1.0 lib/ext/string.rb
git-multi-2.0.0 lib/ext/string.rb
git-multi-1.2.1 lib/ext/string.rb
git-multi-1.2.0 lib/ext/string.rb
git-multi-1.1.0 lib/ext/string.rb