Top Level Namespace

Defined Under Namespace

Classes: Gitmine

Instance Method Summary collapse

Instance Method Details

#blue(text) ⇒ Object



38
39
40
# File 'lib/gitmine/colors.rb', line 38

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

#bold(text) ⇒ Object



14
15
16
# File 'lib/gitmine/colors.rb', line 14

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

#color(text, color_code) ⇒ Object

### COLORS ### Display colored text in console



10
11
12
# File 'lib/gitmine/colors.rb', line 10

def color(text, color_code)
  "#{color_code}#{text}\e[0m"
end

#green(text) ⇒ Object



22
23
24
# File 'lib/gitmine/colors.rb', line 22

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

#grey(text) ⇒ Object



42
43
44
# File 'lib/gitmine/colors.rb', line 42

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

#magenta(text) ⇒ Object



30
31
32
# File 'lib/gitmine/colors.rb', line 30

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

#red(text) ⇒ Object



26
27
28
# File 'lib/gitmine/colors.rb', line 26

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

#run_cmd(cmd) ⇒ Object

Display the command, run it and raise if it fails.



3
4
5
6
# File 'lib/gitmine/colors.rb', line 3

def run_cmd(cmd)
  puts blue(cmd)
  raise unless system cmd
end

#white(text) ⇒ Object



18
19
20
# File 'lib/gitmine/colors.rb', line 18

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

#yellow(text) ⇒ Object



34
35
36
# File 'lib/gitmine/colors.rb', line 34

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