Top Level Namespace

Defined Under Namespace

Modules: Commandline, Commands, Pf Classes: PHPfog, Rest

Instance Method Summary collapse

Instance Method Details

#bblue(str, endColor = 0) ⇒ Object

34 Blue



46
47
48
# File 'lib/pf-command/colorize.rb', line 46

def bblue(str, endColor = 0)
  colorize(str, "1;34", endColor)
end

#bcyan(str, endColor = 0) ⇒ Object

36 Bright Cyan



66
67
68
# File 'lib/pf-command/colorize.rb', line 66

def bcyan(str, endColor = 0)
  colorize(str, "1;36", endColor)
end

#bgreen(str, endColor = 0) ⇒ Object

32 Bright Green



26
27
28
# File 'lib/pf-command/colorize.rb', line 26

def bgreen(str, endColor = 0)
  colorize(str, "1;32", endColor)
end

#black(str, endColor = 0) ⇒ Object

30 Black



6
7
8
# File 'lib/pf-command/colorize.rb', line 6

def black(str, endColor = 0)
  colorize(str, "30", endColor)
end

#blue(str, endColor = 0) ⇒ Object

34 Blue



41
42
43
# File 'lib/pf-command/colorize.rb', line 41

def blue(str, endColor = 0)
  colorize(str, "34", endColor)
end

#bmagenta(str, endColor = 0) ⇒ Object

35 Magenta



56
57
58
# File 'lib/pf-command/colorize.rb', line 56

def bmagenta(str, endColor = 0)
  colorize(str, "1;35", endColor)
end

#bred(str, endColor = 0) ⇒ Object

31 Red



16
17
18
# File 'lib/pf-command/colorize.rb', line 16

def bred(str, endColor = 0)
  colorize(str, "1;31", endColor)
end

#bwhite(str, endColor = 0) ⇒ Object

37 Bright White



76
77
78
# File 'lib/pf-command/colorize.rb', line 76

def bwhite(str, endColor = 0)
  colorize(str, "1;37", endColor)
end

#byellow(str, endColor = 0) ⇒ Object

33 Yellow



36
37
38
# File 'lib/pf-command/colorize.rb', line 36

def byellow(str, endColor = 0)
  colorize(str, "1;33", endColor)
end

#colorize(str, beginColor, endColor = 0) ⇒ Object



1
2
3
# File 'lib/pf-command/colorize.rb', line 1

def colorize(str, beginColor, endColor = 0)
  "\e[#{beginColor}m#{str}\e[#{endColor}m"
end

#cyan(str, endColor = 0) ⇒ Object

36 Cyan



61
62
63
# File 'lib/pf-command/colorize.rb', line 61

def cyan(str, endColor = 0)
  colorize(str, "36", endColor)
end

#green(str, endColor = 0) ⇒ Object

32 Green



21
22
23
# File 'lib/pf-command/colorize.rb', line 21

def green(str, endColor = 0)
  colorize(str, "32", endColor)
end

#magenta(str, endColor = 0) ⇒ Object

35 Magenta



51
52
53
# File 'lib/pf-command/colorize.rb', line 51

def magenta(str, endColor = 0)
  colorize(str, "35", endColor)
end

#prompt(msg, isPassword = false) ⇒ Object



1
2
3
4
5
6
7
8
9
10
# File 'lib/pf-command/prompt.rb', line 1

def prompt(msg, isPassword = false)
  print(msg)
  system "stty -echo" if isPassword
  input = gets
  if isPassword 
    system "stty echo"
    puts ''
  end
  input.strip
end

#red(str, endColor = 0) ⇒ Object

31 Red



11
12
13
# File 'lib/pf-command/colorize.rb', line 11

def red(str, endColor = 0)
  colorize(str, "31", endColor)
end

#white(str, endColor = 0) ⇒ Object

37 White



71
72
73
# File 'lib/pf-command/colorize.rb', line 71

def white(str, endColor = 0)
  colorize(str, "37", endColor)
end

#yellow(str, endColor = 0) ⇒ Object

33 Yellow



31
32
33
# File 'lib/pf-command/colorize.rb', line 31

def yellow(str, endColor = 0)
  colorize(str, "33", endColor)
end