Class: Approvals::Reporters::HtmlImageReporter
- Inherits:
-
Object
- Object
- Approvals::Reporters::HtmlImageReporter
- Includes:
- Singleton
- Defined in:
- lib/approvals/reporters/image_reporter/html_image_reporter.rb
Instance Method Summary collapse
- #display(page) ⇒ Object
- #html(received, approved) ⇒ Object
- #report(received, approved) ⇒ Object
- #working_in_this_environment? ⇒ Boolean
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.(received), File.(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
6 7 8 |
# File 'lib/approvals/reporters/image_reporter/html_image_reporter.rb', line 6 def working_in_this_environment? true end |