Module: Leftovers::TodoReporter

Defined in:
lib/leftovers/todo_reporter.rb

Class Method Summary collapse

Class Method Details

.prepareObject



8
9
10
11
12
13
14
# File 'lib/leftovers/todo_reporter.rb', line 8

def prepare
  return unless path.exist?

  puts "Removing previous #{path.basename} file"
  puts ''
  path.delete
end

.report(collection) ⇒ Object



16
17
18
19
20
21
# File 'lib/leftovers/todo_reporter.rb', line 16

def report(collection)
  path.write(generate_file_body(collection))
  report_instructions

  0
end

.report_successObject



23
24
25
26
27
# File 'lib/leftovers/todo_reporter.rb', line 23

def report_success
  puts "No #{path.basename} file generated, everything is used"

  0
end