class TaskJuggler::FileList

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.

Public Class Methods

new() click to toggle source

Create a new, empty FileList.

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

Public Instance Methods

<<(fileName) click to toggle source

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

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

  @files[fileName] = FileRecord.new(fileName)
end
masterFile() click to toggle source

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

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

  nil
end
modified?() click to toggle source

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

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