Class: Concrete::WorkingSet

Inherits:
Object
  • Object
show all
Defined in:
lib/concrete/working_set.rb

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ WorkingSet

Returns a new instance of WorkingSet.



7
8
9
10
# File 'lib/concrete/working_set.rb', line 7

def initialize(root)
  @root = Pathname.new(root).realpath
  @filesByIdent = {}
end

Instance Method Details

#addFile(file) ⇒ Object



12
13
14
# File 'lib/concrete/working_set.rb', line 12

def addFile(file)
  @filesByIdent[ident(file)] = file
end

#fileIdentifiersObject



20
21
22
# File 'lib/concrete/working_set.rb', line 20

def fileIdentifiers
  @filesByIdent.keys.sort
end

#getFile(fileIdent) ⇒ Object



24
25
26
# File 'lib/concrete/working_set.rb', line 24

def getFile(fileIdent)
  @filesByIdent[fileIdent]
end

#removeFile(file) ⇒ Object



16
17
18
# File 'lib/concrete/working_set.rb', line 16

def removeFile(file)
  @filesByIdent.delete(ident(file)) 
end

#rootPathObject



28
29
30
# File 'lib/concrete/working_set.rb', line 28

def rootPath
  @root.to_s
end