module Callsite::LoadPathMethods

Public Instance Methods

add_current() click to toggle source
# File lib/callsite.rb, line 108
def add_current
  self << __DIR_REL__(caller.first)
end
add_current!() click to toggle source
# File lib/callsite.rb, line 112
def add_current!
  self.unshift(__DIR_REL__(caller.first))
end
find_all_files(file, ext = nil) { |target| ... } click to toggle source
# File lib/callsite.rb, line 96
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/callsite.rb, line 91
def find_file(file)
  find_all_files(file){|f| return f}
  nil
end