Class: Lad::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/console.rb

Class Method Summary collapse

Class Method Details

.error(msg) ⇒ Object



11
12
13
# File 'lib/console.rb', line 11

def self.error msg
  puts msg.red
end

.log(msg) ⇒ Object



3
4
5
# File 'lib/console.rb', line 3

def self.log msg
  puts msg
end

.success(msg) ⇒ Object



15
16
17
# File 'lib/console.rb', line 15

def self.success msg
  puts msg.green
end

.task(msg, &block) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/console.rb', line 19

def self.task msg, &block
  print "  #{msg}".ljust(40)
  begin
    block.call
    puts "OK".green
  rescue Exception => e  
    puts "XX".red
    raise e
  end
end

.warn(msg) ⇒ Object



7
8
9
# File 'lib/console.rb', line 7

def self.warn msg
  puts msg.yellow
end