Class TaskJuggler::FileList
In: lib/taskjuggler/FileList.rb
Parent: Object

The FileList class stores a list of file names. Each file name is unique and more information about the file is contained in FileRecord entries.

Methods

<<   masterFile   modified?   new  

Public Class methods

Create a new, empty FileList.

[Source]

# File lib/taskjuggler/FileList.rb, line 35
    def initialize
      @files = {}
    end

Public Instance methods

Add the file with fileName to the list. If it‘s already in the list, it will not be added again.

[Source]

# File lib/taskjuggler/FileList.rb, line 41
    def <<(fileName)
      return if fileName == '.' || @files.include?(fileName)

      @files[fileName] = FileRecord.new(fileName)
    end

Return the name of the master file or nil of the master file was stdin.

[Source]

# File lib/taskjuggler/FileList.rb, line 48
    def masterFile
      @files.each_key do |file|
        return file if file[-4, 4] == '.tjp'
      end

      nil
    end

Return true if any of the files in the list have been modified after they were added to the list.

[Source]

# File lib/taskjuggler/FileList.rb, line 58
    def modified?
      @files.each_value do |f|
        return true if f.modified?
      end
      false
    end

[Validate]