Class: Hike::Paths

Inherits:
NormalizedArray show all
Defined in:
lib/hike/paths.rb

Instance Method Summary collapse

Methods inherited from NormalizedArray

#<<, #[]=, #collect!, #insert, #normalize_elements, #push, #replace, #unshift

Constructor Details

#initialize(root = ".") ⇒ Paths

Returns a new instance of Paths.



3
4
5
6
# File 'lib/hike/paths.rb', line 3

def initialize(root = ".")
  @root = root
  super()
end

Instance Method Details

#normalize_element(path) ⇒ Object



8
9
10
11
# File 'lib/hike/paths.rb', line 8

def normalize_element(path)
  path = File.join(@root, path) unless path[/^\//]
  File.expand_path(path)
end