Class: Ajimi::Reporter

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

Instance Method Summary collapse

Constructor Details

#initialize(checker, report_template_path = nil) ⇒ Reporter

Returns a new instance of Reporter.



6
7
8
9
# File 'lib/ajimi/reporter.rb', line 6

def initialize(checker, report_template_path = nil)
  @checker = checker
  @report_template_path = report_template_path || File.expand_path('../reporter/template.erb', __FILE__)
end

Instance Method Details

#reportObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/ajimi/reporter.rb', line 11

def report
  if @checker.result
    puts "no diffs"
    true
  else
    erb = File.read(@report_template_path)
    puts ERB.new(erb, nil, '-').result(binding)
    false
  end
end