Class: Remoting::Shell

Inherits:
Thor::Shell::Color
  • Object
show all
Defined in:
lib/remoting/shell.rb

Instance Method Summary collapse

Instance Method Details

#ask_password(*args) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/remoting/shell.rb', line 5

def ask_password(*args)
  system "stty -echo" 
  res = ask(*args)
  system "stty echo"
  puts("\n") 
  res
end

#bold(message) ⇒ Object



21
22
23
# File 'lib/remoting/shell.rb', line 21

def bold(message)
  say(message, BOLD)
end

#continue?(message) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
# File 'lib/remoting/shell.rb', line 13

def continue?(message)
  res = yes?(message << " (y/yes)")
  if !res
    say("Cancelled", BLUE)
  end
  res
end

#error(message) ⇒ Object



33
34
35
# File 'lib/remoting/shell.rb', line 33

def error(message)
  say(message, RED)
end

#no?(message) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/remoting/shell.rb', line 25

def no?(message)
  super(message << " (n/no)")
end

#success(message) ⇒ Object



29
30
31
# File 'lib/remoting/shell.rb', line 29

def success(message)
  say(message, GREEN)
end