Class: Standupguy::HTMLReport

Inherits:
Report
  • Object
show all
Defined in:
lib/Standupguy.rb

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

#current_standup, #date

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

#fileObject



132
133
134
# File 'lib/Standupguy.rb', line 132

def file
  @file ||= Tempfile.new(["report", ".html"])
end

#renderObject



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

#showObject



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