Module: Trepan::Display

Included in:
Trepan
Defined in:
app/display.rb

Instance Method Summary collapse

Instance Method Details

#ask(str) ⇒ Object



31
32
33
# File 'app/display.rb', line 31

def ask(str)
  Readline.readline("| #{str}")
end

#crit(str) ⇒ Object



13
14
15
# File 'app/display.rb', line 13

def crit(str)
  puts "[CRITICAL] #{str}"
end

#display(str) ⇒ Object



9
10
11
# File 'app/display.rb', line 9

def display(str)
  puts "=> #{str}"
end

#error(str, prefix = '** ') ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'app/display.rb', line 17

def error(str, prefix='** ')
  if str.is_a?(Array)
    str.each{|s| error(s)}
  else
    str.split("\n").each do |s|
      puts "%s%s" % [prefix, s]
    end
  end
end

#info(str) ⇒ Object



3
4
5
6
7
# File 'app/display.rb', line 3

def info(str)
  str.split("\n").each do |s|
    puts "| #{s}"
  end
end

#section(str) ⇒ Object



27
28
29
# File 'app/display.rb', line 27

def section(str)
  puts "==== #{str} ===="
end