Class: Regenerate::PathAndParents
- Inherits:
-
Object
- Object
- Regenerate::PathAndParents
- Defined in:
- lib/regenerate/site-regenerator.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(path) ⇒ PathAndParents
constructor
A new instance of PathAndParents.
Constructor Details
#initialize(path) ⇒ PathAndParents
Returns a new instance of PathAndParents.
8 9 10 |
# File 'lib/regenerate/site-regenerator.rb', line 8 def initialize(path) @path = path end |
Instance Method Details
#each ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/regenerate/site-regenerator.rb', line 12 def each currentPath = @path topLevel = false while !topLevel do yield currentPath parentPath = File.dirname(currentPath) topLevel = parentPath == currentPath currentPath = parentPath end end |