Sha256: b697a6a5e3c0b1f10da5e50b6270dea140b2830dc4d9a1b4a461c2d4c31b617e

Contents?: true

Size: 694 Bytes

Versions: 13

Compression:

Stored size: 694 Bytes

Contents

#module Gitmine::Colors
  # Display the command, run it and raise if it fails.
  def run_cmd(cmd)
    puts blue(cmd)
    raise unless system cmd
  end

  # ### COLORS ###
  # Display colored text in console
  def color(text, color_code)
    "#{color_code}#{text}\e[0m"
  end 

  def bold(text)
    color(text, "\e[1m")
  end 

  def white(text)
    color(text, "\e[37m")
  end 

  def green(text)
    color(text, "\e[32m")
  end 

  def red(text)
    color(text, "\e[31m")
  end 

  def magenta(text)
    color(text, "\e[35m")
  end 

  def yellow(text)
    color(text, "\e[33m")
  end 

  def blue(text)
    color(text, "\e[34m")
  end 

  def grey(text)
    color(text, "\e[90m")
  end 
#end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gitmine-0.2.1 lib/gitmine/colors.rb
gitmine-0.2.0 lib/gitmine/colors.rb
gitmine-0.1.16 lib/gitmine/colors.rb
gitmine-0.1.15 lib/gitmine/colors.rb
gitmine-0.1.14 lib/gitmine/colors.rb
gitmine-0.1.13 lib/gitmine/colors.rb
gitmine-0.1.12 lib/gitmine/colors.rb
gitmine-0.1.11 lib/gitmine/colors.rb
gitmine-0.1.10 lib/gitmine/colors.rb
gitmine-0.1.9 lib/gitmine/colors.rb
gitmine-0.1.8 lib/gitmine/colors.rb
gitmine-0.1.7 lib/gitmine/colors.rb
gitmine-0.1.6 lib/gitmine/colors.rb