Class: FeduxOrgStdlib::Project::Plan
- Inherits:
-
Object
- Object
- FeduxOrgStdlib::Project::Plan
- Defined in:
- lib/fedux_org_stdlib/project/plan.rb
Instance Method Summary collapse
-
#initialize(main_file: File.join(Dir.getwd, 'plan.tjp'), additional_files: []) ⇒ Plan
constructor
Create a new project plan.
-
#needs_to_be_compiled?(base_file) ⇒ true, false
Does the plan needs to be compiled.
-
#to_s ⇒ String
Output a textual representation of self.
Constructor Details
#initialize(main_file: File.join(Dir.getwd, 'plan.tjp'), additional_files: []) ⇒ Plan
Create a new project plan
19 20 21 22 23 24 25 |
# File 'lib/fedux_org_stdlib/project/plan.rb', line 19 def initialize( main_file: File.join(Dir.getwd, '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
34 35 36 |
# File 'lib/fedux_org_stdlib/project/plan.rb', line 34 def needs_to_be_compiled?(base_file) (Array(main_file) + additional_files).any? { |f| File.mtime(f) > File.mtime(base_file) } end |
#to_s ⇒ String
Output a textual representation of self
42 43 44 |
# File 'lib/fedux_org_stdlib/project/plan.rb', line 42 def to_s main_file end |