Class: Approvals::Reporters::HtmlImageReporter

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/approvals/reporters/image_reporter/html_image_reporter.rb

Instance Method Summary collapse

Instance Method Details

#display(page) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/approvals/reporters/image_reporter/html_image_reporter.rb', line 18

def display(page)
  filename = "#{Approvals.tmp_path}tmp-#{rand(Time.now.to_i)}.html"
  File.open(filename, 'w') do |file|
    file.write page
  end
  system("open #{filename}")
end

#html(received, approved) ⇒ Object



14
15
16
# File 'lib/approvals/reporters/image_reporter/html_image_reporter.rb', line 14

def html(received, approved)
  template(File.expand_path(received), File.expand_path(approved))
end

#report(received, approved) ⇒ Object



10
11
12
# File 'lib/approvals/reporters/image_reporter/html_image_reporter.rb', line 10

def report(received, approved)
  display html(received, approved)
end

#working_in_this_environment?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/approvals/reporters/image_reporter/html_image_reporter.rb', line 6

def working_in_this_environment?
  true
end