Module: Ghaki::Report::Mixin::OutputFile

Defined in:
lib/ghaki/report/mixin/output_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#output_fileObject

Returns the value of attribute output_file.



9
10
11
# File 'lib/ghaki/report/mixin/output_file.rb', line 9

def output_file
  @output_file
end

Instance Method Details

#initialize(opts = {}) ⇒ Object



11
12
13
# File 'lib/ghaki/report/mixin/output_file.rb', line 11

def initialize opts={} ; super opts
  @output_file = opts[:output_file]
end

#output_finishObject



23
24
# File 'lib/ghaki/report/mixin/output_file.rb', line 23

def output_finish
end

#output_prepareObject



26
27
28
# File 'lib/ghaki/report/mixin/output_file.rb', line 26

def output_prepare
  logger.info 'output file: ' + @output_file
end

#output_reportObject



15
16
17
18
19
20
21
# File 'lib/ghaki/report/mixin/output_file.rb', line 15

def output_report
  output_prepare
  File.with_opened_temp @output_file do |tmp_file|
    output_to_format tmp_file
  end
  output_finish
end

#output_to_format(out_file) ⇒ Object



30
31
# File 'lib/ghaki/report/mixin/output_file.rb', line 30

def output_to_format out_file
end