class Object

Public Instance Methods

add(path) click to toggle source
# File lib/loaders/load_path.rb, line 27
def add(path)
  push(path) unless include?(path)
end
add!(path) click to toggle source
# File lib/loaders/load_path.rb, line 31
def add!(path)
  delete(path)
  unshift(path)
end
add_current() click to toggle source
# File lib/loaders/load_path.rb, line 19
def add_current
  add(__DIR_REL__(caller.first))
end
add_current!() click to toggle source
# File lib/loaders/load_path.rb, line 23
def add_current!
  add!(__DIR_REL__(caller.first))
end
find_all_files(file, ext = nil) { |target| ... } click to toggle source
# File lib/loaders/load_path.rb, line 7
def find_all_files(file, ext = nil)
  file += ext if ext and File.extname(file) != ext
  inject([]){|ary, path| 
    target = File.expand_path(file, path)
    if File.readable?(target)
      ary << target
      yield target if block_given?
    end
    ary
  }
end
find_file(file) click to toggle source
# File lib/loaders/load_path.rb, line 2
def find_file(file)
  find_all_files(file){|f| return f}
  nil
end