Class: Standupguy::HTMLReport
Overview
HTML Formatted report. Creates a tempfile that is deleted in 5 seconds. Tempfile is opened in browser using Launchy.
Instance Attribute Summary
Attributes inherited from Report
Instance Method Summary collapse
Methods inherited from Report
#data, #initialize, #link, #template
Methods included from DataMethods
#date_key, #filename, #load_data, #write_data
Constructor Details
This class inherits a constructor from Standupguy::Report
Instance Method Details
#file ⇒ Object
132 133 134 |
# File 'lib/Standupguy.rb', line 132 def file @file ||= Tempfile.new(["report", ".html"]) end |
#render ⇒ Object
127 128 129 130 |
# File 'lib/Standupguy.rb', line 127 def render ::Haml::Engine.new(template("report.html.haml")). render(Object.new, standup: data(@date)) end |
#show ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/Standupguy.rb', line 119 def show File.write(file, render) file.close Launchy.open link Kernel.sleep 5 file.unlink end |