Class: GitHealthCheck::Report
- Inherits:
-
Object
- Object
- GitHealthCheck::Report
- Defined in:
- lib/git-health-check/report.rb
Instance Method Summary collapse
- #create ⇒ Object
- #get_binding ⇒ Object
- #get_template ⇒ Object
-
#initialize(working_copy, history, packfile, options) ⇒ Report
constructor
A new instance of Report.
Constructor Details
#initialize(working_copy, history, packfile, options) ⇒ Report
Returns a new instance of Report.
7 8 9 10 11 12 13 |
# File 'lib/git-health-check/report.rb', line 7 def initialize(working_copy, history, packfile, ) @working_copy = working_copy @history = history @packfile = packfile @repository = [:repository] @report_directory = @repository + '/healthcheck' end |
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/git-health-check/report.rb', line 23 def create rhtml = ERB.new(get_template) output = rhtml.result(get_binding) Dir.mkdir @report_directory unless File.directory? @report_directory File.open(@report_directory + '/report.html', 'w+') do |f| f.write output end end |
#get_binding ⇒ Object
15 16 17 |
# File 'lib/git-health-check/report.rb', line 15 def get_binding binding end |
#get_template ⇒ Object
19 20 21 |
# File 'lib/git-health-check/report.rb', line 19 def get_template File.read(File.dirname(__FILE__) + '/report/report.erb') end |