Sha256: fa93cc0832dc8a913f102f3099ee9fe24625a5a287983676d9a175562434fe1e
Contents?: true
Size: 1.17 KB
Versions: 56
Compression:
Stored size: 1.17 KB
Contents
# encoding: utf-8 module FeduxOrgStdlib module Project # Plan file class Plan private attr_reader :main_file, :additional_files public # Create a new project plan # # @param [String] main_file # The main project file # @param [Array] additional_files # Additional files containing information about project plan def initialize( main_file: File.expand_path('plan.tjp'), additional_files: [] ) @main_file = main_file @additional_files = Array(additional_files) end # Does the plan needs to be compiled # # @param [String] base_file # The output file which should be used to determine if the report is # older then the project plan # @return [true,false] # Result of comparism def needs_to_be_compiled?(base_file) (Array(main_file) + additional_files).any? { |f| File.mtime(f) > File.mtime(base_file) } end # Output a textual representation of self # # @return [String] # The path to the main file of the project plan def to_s main_file end end end end
Version data entries
56 entries across 56 versions & 1 rubygems