Module: PathLoader

Defined in:
lib/path_loader.rb,
lib/path_loader/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.load(path) ⇒ Object



5
6
7
# File 'lib/path_loader.rb', line 5

def load(path)
  $:.unshift(path)
end

.load_relative(path) ⇒ Object



9
10
11
12
# File 'lib/path_loader.rb', line 9

def load_relative(path)
  file = caller.first.split(/:\d/,2).first
  $:.unshift File.expand_path(path, File.dirname(file))
end