module Finder::Find

Find module is the main interface for Finder library.

Constants

EXTENSIONS

TODO: expand on extensions

Public Instance Methods

[](match, options={})

Shortcut for path.

Find['lib/foo/*']
Alias for: path
data_path(match, options={}) click to toggle source

Searching through all systems for matching data paths.

@param [String] match

File glob to match against.

@example

Find.data_path('bar/*')
# File lib/finder/find.rb, line 48
def data_path(match, options={})
  found = []
  systems.each do |system|
    found.concat system.data_path(match, options)
  end
  found.uniq
end
feature(match, options={}) click to toggle source

Searching through all systems for matching requirable feature files.

@param [String] match

File glob to match against.

@example

Find.feature('ostruct')
# File lib/finder/find.rb, line 96
def feature(match, options={})
  found = []
  systems.each do |system|
    found.concat system.feature(match, options)
  end
  found.uniq
end
load_path(match, options={}) click to toggle source

Searching through all systems for matching load paths.

@param [String] match

File glob to match against.

@example

Find.load_path('bar/*')
# File lib/finder/find.rb, line 64
def load_path(match, options={})
  found = []
  systems.each do |system|
    found.concat system.load_path(match, options)
  end
  found.uniq
end
path(match, options={}) click to toggle source

Find matching paths, searching through Rolled libraries, Gem-installed libraries and site locations in ‘$LOAD_PATH` and `RbConfig::CONFIG`.

@param [String] match

File glob to match against.

@example

Find.path('lib/foo/*')
# File lib/finder/find.rb, line 26
def path(match, options={})
  found = []
  systems.each do |system|
    found.concat system.path(match, options)
  end
  found.uniq
end
Also aliased as: []
systems() click to toggle source

List of supported library management systems.

# File lib/finder/find.rb, line 107
def systems
  @systems ||= (
    systems = []
    systems << Roll if defined?(::Library)
    systems << Gem  if defined?(::Gem)
    systems << Site
    systems
  )
end