Class: FeduxOrgStdlib::Project::Report
- Inherits:
-
Object
- Object
- FeduxOrgStdlib::Project::Report
- Defined in:
- lib/fedux_org_stdlib/project/report.rb
Overview
Taskjugger report
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#generate ⇒ Object
Generate report.
-
#initialize(plan:, output_file:, generator: FeduxOrgStdlib::Project::Generators::Taskjuggler.new) ⇒ Report
constructor
Create a new report.
-
#open ⇒ Object
Open report in web browser.
Constructor Details
#initialize(plan:, output_file:, generator: FeduxOrgStdlib::Project::Generators::Taskjuggler.new) ⇒ Report
Create a new report
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fedux_org_stdlib/project/report.rb', line 30 def initialize( plan:, output_file:, generator: FeduxOrgStdlib::Project::Generators::Taskjuggler.new ) @plan = plan @output_directory = File.dirname(output_file) @output_file = output_file @generator = generator end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
14 15 16 |
# File 'lib/fedux_org_stdlib/project/report.rb', line 14 def directory @directory end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
14 15 16 |
# File 'lib/fedux_org_stdlib/project/report.rb', line 14 def file @file end |
Instance Method Details
#generate ⇒ Object
Generate report
42 43 44 45 46 47 48 49 50 |
# File 'lib/fedux_org_stdlib/project/report.rb', line 42 def generate prepare_environment if output_file_does_not_exist? || plan_is_newer_than_output_file? generator.generate_report(output_directory, plan) else FeduxOrgStdlib::Project.logger.warn "No need to re-generate report. The plan file \"#{plan}\" is NOT newer than output \"#{@output_file}\"." end end |
#open ⇒ Object
Open report in web browser
53 54 55 |
# File 'lib/fedux_org_stdlib/project/report.rb', line 53 def open Launchy.open(output_file) end |