Parent

Namespace

Methods

Included Modules

PathList

PathList

A PathList is an array containing 1..n paths. It is useful to regroup paths and make lookups on them.

Usage

 path = PathList.new(ENV['PATH'])
 path.find 'env'            #=> "/usr/bin/env"

 # This is already done when including the library
 $:.class                   #=> Array
 $:.extend PathList::Finder
 $:.find_ext = 'rb'

 $:.find 'uri'              #=> "/usr/lib/ruby/1.8/uri.rb"

Public Class Methods

new(paths, default_ext = nil) click to toggle source
    # File lib/more/facets/pathlist.rb, line 55
55:   def initialize(paths, default_ext = nil)
56:     @find_ext = default_ext
57:     if paths.kind_of? String
58:       paths = paths.split(File::PATH_SEPARATOR)
59:     end
60:     super(paths)
61:   end

Public Instance Methods

to_s() click to toggle source
    # File lib/more/facets/pathlist.rb, line 63
63:   def to_s
64:     join(File::PATH_SEPARATOR)
65:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.