Class: Hike::Paths
- Inherits:
-
NormalizedArray
- Object
- Array
- NormalizedArray
- Hike::Paths
- Defined in:
- lib/hike/paths.rb
Overview
‘Paths` is an internal collection for tracking path strings.
Instance Method Summary collapse
-
#initialize(root = ".") ⇒ Paths
constructor
A new instance of Paths.
-
#normalize_element(path) ⇒ Object
Relative paths added to this array are expanded relative to ‘@root`.
Methods inherited from NormalizedArray
#<<, #[]=, #collect!, #insert, #normalize_elements, #push, #replace, #unshift
Constructor Details
Instance Method Details
#normalize_element(path) ⇒ Object
21 22 23 24 25 |
# File 'lib/hike/paths.rb', line 21 def normalize_element(path) path = Pathname.new(path) path = @root.join(path) if path.relative? path..to_s end |