Class: Chartspec::Printer

Inherits:
Object
  • Object
show all
Includes:
ERB::Util
Defined in:
lib/chartspec/printer.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Printer

Returns a new instance of Printer.



7
8
9
# File 'lib/chartspec/printer.rb', line 7

def initialize(output)
  @output = output
end

Instance Method Details

#flushObject



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

def flush
  @output.flush
end


20
21
22
23
# File 'lib/chartspec/printer.rb', line 20

def print_html_end
  chartspec_footer = ERB.new File.new(File.expand_path("../../../templates/chartspec_footer.html.erb", __FILE__)).read
  @output.puts chartspec_footer.result(binding)
end


11
12
13
14
# File 'lib/chartspec/printer.rb', line 11

def print_html_start
  chartspec_header = ERB.new File.new(File.expand_path("../../../templates/chartspec_header.html.erb", __FILE__)).read
  @output.puts chartspec_header.result(binding)
end