Class: Munge::Formatter::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/munge/formatter/default.rb

Instance Method Summary collapse

Constructor Details

#initializeDefault

Returns a new instance of Default.



4
5
6
7
8
9
# File 'lib/munge/formatter/default.rb', line 4

def initialize
  @new_count = 0
  @changed_count = 0
  @identical_count = 0
  @reported_count = 0
end

Instance Method Details

#call(_item, relpath, write_status, should_print) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/munge/formatter/default.rb', line 11

def call(_item, relpath, write_status, should_print)
  case write_status
  when :new
    report_new(relpath, should_print)
  when :changed
    report_changed(relpath, should_print)
  when :identical
    report_identical(relpath, should_print)
  end
end

#doneObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/munge/formatter/default.rb', line 28

def done
  @done_time = Time.now

  report = [
    "Wrote #{@new_count + @changed_count}",
    "Processed #{@new_count + @changed_count + @identical_count}"
  ]

  puts report.join(", ")
  puts "Took #{@done_time - @start_time} seconds"
end

#startObject



22
23
24
25
26
# File 'lib/munge/formatter/default.rb', line 22

def start
  @start_time = Time.now

  puts "Started build"
end