Module: SiteValidator::Reporter

Extended by:
Reporter
Included in:
Reporter
Defined in:
lib/site_validator/reporter.rb

Instance Method Summary collapse

Instance Method Details

#generate_html(sitemap, filename) ⇒ Object

Create the html report for the sitemap



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

def generate_html(sitemap, filename)
  template = ERB.new(open(File.dirname(__FILE__)+'/templates/site_validator.html.erb').read)

  File.open(filename, 'w') do |f|
    f.write(template.result(sitemap.get_binding))
  end
rescue Exception => e
  puts "ERROR generating report: #{e}"
end