class Similatron::HtmlReport

Attributes

run[R]

Public Class Methods

new(run) click to toggle source
# File lib/similatron/html_report.rb, line 6
def initialize(run)
  @run = run
  @time = Time.now
end

Public Instance Methods

css_styles() click to toggle source
# File lib/similatron/html_report.rb, line 17
def css_styles
  ["normalize.css", "skeleton.css"].map do |file|
    css_path = File.join(Similatron.lib_path, "assets/Skeleton-2.0.4/css", file)
    File.read(css_path)
  end
end
failures?() click to toggle source
# File lib/similatron/html_report.rb, line 36
def failures?
  !run.failed_comparisons.empty?
end
full_path(path) click to toggle source
# File lib/similatron/html_report.rb, line 24
def full_path(path)
  File.expand_path(path)
end
ok?() click to toggle source
# File lib/similatron/html_report.rb, line 40
def ok?
  !overwrites? && !failures?
end
overwrites?() click to toggle source
# File lib/similatron/html_report.rb, line 32
def overwrites?
  !run.overwrite_comparisons.empty?
end
render() click to toggle source
# File lib/similatron/html_report.rb, line 11
def render
  template_path = File.join(Similatron.lib_path, "assets/report.html.erb")
  template = ERB.new(File.read(template_path))
  template.result(binding)
end
run_at() click to toggle source
# File lib/similatron/html_report.rb, line 28
def run_at
  @time.strftime("%b %d, %Y %H:%M")
end