Class: FeduxOrgStdlib::Project::Plan

Inherits:
Object
  • Object
show all
Defined in:
lib/fedux_org_stdlib/project/plan.rb

Overview

Plan file

Instance Method Summary collapse

Constructor Details

#initialize(main_file: File.expand_path('plan.tjp'), additional_files: []) ⇒ Plan

Create a new project plan



18
19
20
21
22
23
24
# File 'lib/fedux_org_stdlib/project/plan.rb', line 18

def initialize(
  main_file: File.expand_path('plan.tjp'),
  additional_files: []
)
  @main_file        = main_file
  @additional_files = Array(additional_files)
end

Instance Method Details

#needs_to_be_compiled?(base_file) ⇒ true, false

Does the plan needs to be compiled



33
34
35
# File 'lib/fedux_org_stdlib/project/plan.rb', line 33

def needs_to_be_compiled?(base_file)
  (Array(main_file) + additional_files).any? { |f| File.mtime(f) > File.mtime(base_file) }
end

#to_sString

Output a textual representation of self



41
42
43
# File 'lib/fedux_org_stdlib/project/plan.rb', line 41

def to_s
  main_file
end