Class: FeduxOrgStdlib::Rake::ProjectTask

Inherits:
Task
  • Object
show all
Defined in:
lib/fedux_org_stdlib/rake/project_task.rb

Overview

Project Task

See Also:

  • Rakefile

Instance Attribute Summary collapse

Attributes inherited from Task

#description, #name, #verbose, #verbose (true)

Instance Method Summary collapse

Methods inherited from Task

#include, #instance_binding

Constructor Details

#initialize(report_file: File.join(Dir.getwd, 'reports', 'Overview.html'), plan_file: File.join(Dir.getwd, 'plan.tjp'), additional_files: [], **args) ⇒ ProjectTask

Create a new project task

Examples:

Create new task

FeduxOrgStdlib::Rake::ProjectTask.new

Create new task using a different report file

FeduxOrgStdlib::Rake::ProjectTask.new(
  report_file: File.join(Dir.getwd, 'reports', 'Index.html')
)

Create new task using a different project plan and adding additional files

FeduxOrgStdlib::Rake::ProjectTask.new(
  plan_file: File.join(Dir.getwd, 'project1.tjp'),
  additional_files: %W{
  #{File.join(Dir.getwd, 'resources.tjp')}
  #{File.join(Dir.getwd, 'leaves.tjp')}
  }
)

Parameters:

  • report_file (String) (defaults to: File.join(Dir.getwd, 'reports', 'Overview.html'))

    The main report file

  • plan_file (String) (defaults to: File.join(Dir.getwd, 'plan.tjp'))

    The main plan file

  • additional_files (Array) (defaults to: [])

    A list of additional files for the project plan



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/fedux_org_stdlib/rake/project_task.rb', line 40

def initialize(
  report_file: File.join(Dir.getwd, 'reports', 'Overview.html'),
  plan_file: File.join(Dir.getwd, 'plan.tjp'),
  additional_files: [],
  **args
)
  super(**args)

  plan    = FeduxOrgStdlib::Project::Plan.new(main_file: plan_file, additional_files: additional_files)
  @report = FeduxOrgStdlib::Project::Report.new(plan: plan, output_file: report_file)
end

Instance Attribute Details

#reportObject (readonly)

Returns the value of attribute report.



13
14
15
# File 'lib/fedux_org_stdlib/rake/project_task.rb', line 13

def report
  @report
end