Class: Log

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

Instance Method Summary collapse

Constructor Details

#initializeLog

Returns a new instance of Log.



4
5
6
# File 'lib/log.rb', line 4

def initialize
  @p = Pastel.new
end

Instance Method Details

#added(a) ⇒ Object



16
17
18
# File 'lib/log.rb', line 16

def added(a)
  puts @p.green("added #{@p.yellow(a)}")
end

#deleted(d) ⇒ Object



8
9
10
# File 'lib/log.rb', line 8

def deleted(d)
  puts @p.green("part deleted #{@p.yellow(d)}")
end

#error(cmd, data) ⇒ Object



35
36
37
38
39
40
# File 'lib/log.rb', line 35

def error(cmd, data)
  puts @p.cyan("==> #{cmd}")
  puts ''
  puts @p.red(data)
  puts ''
end

#result(cmd, data) ⇒ Object



28
29
30
31
32
33
# File 'lib/log.rb', line 28

def result(cmd, data)
  puts @p.cyan("==> #{cmd}")
  puts ''
  puts @p.green(data)
  puts ''
end

#show_current_session(session) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/log.rb', line 20

def show_current_session(session)
  puts @p.green.bold("URL:\n  #{@p.yellow(session['url'])}")
  puts @p.green.bold("Parts:")
  session['parts'].each_with_index do |part, index|
    puts "  #{@p.blue(index)} - #{@p.yellow(part)}"
  end
end

#url_set(u) ⇒ Object



12
13
14
# File 'lib/log.rb', line 12

def url_set(u)
  puts @p.green("url set #{@p.yellow(u)}")
end