Class Index [+]

Quicksearch

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
 7:     def initialize(root = ".")
 8:       @root = Pathname.new(root)
 9:       super()
10:     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
21:     def normalize_element(path)
22:       path = Pathname.new(path)
23:       path = @root.join(path) if path.relative?
24:       path.expand_path.to_s
25:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.