Class: Concrete::WorkingSet
- Inherits:
-
Object
- Object
- Concrete::WorkingSet
- Defined in:
- lib/concrete/working_set.rb
Instance Method Summary collapse
- #addFile(file) ⇒ Object
- #fileIdentifiers ⇒ Object
- #getFile(fileIdent) ⇒ Object
-
#initialize(root) ⇒ WorkingSet
constructor
A new instance of WorkingSet.
- #removeFile(file) ⇒ Object
- #rootPath ⇒ Object
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 |
#fileIdentifiers ⇒ Object
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 |
#rootPath ⇒ Object
28 29 30 |
# File 'lib/concrete/working_set.rb', line 28 def rootPath @root.to_s end |