Class: Hike::Paths

### Home Classes Methods

### In Files

- lib/hike/paths.rb

### Parent

Hike::NormalizedArray

### Methods

- ::new
- #normalize_element

### Class/Module Index

Quicksearch

- Hike
- Hike::Extensions
- Hike::Index
- Hike::NormalizedArray
- Hike::Paths
- Hike::Trail

No matching classes.

# Hike::Paths

`Paths` is an internal collection for tracking path strings.

### Public Class Methods

new(root = ".") click to toggle source

    # File lib/hike/paths.rb, line 7
    def initialize(root = ".")
      @root = Pathname.new(root)
      super()
    end

### Public Instance Methods

normalize_element(path) click to toggle source

Relative paths added to this array are expanded relative to `@root`.

    paths = Paths.new("/usr/local")
    paths << "tmp"
    paths << "/tmp"

    paths
    # => ["/usr/local/tmp", "/tmp"]

    # File lib/hike/paths.rb, line 21
    def normalize_element(path)
      path = Pathname.new(path)
      path = @root.join(path) if path.relative?
      path.expand_path.to_s
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.