Module: LoadPath

Defined in:
lib/load-me.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.base_pathObject

Returns the value of attribute base_path.



3
4
5
# File 'lib/load-me.rb', line 3

def base_path
  @base_path
end

Class Method Details

.add(*names) ⇒ Object



10
11
12
13
14
15
# File 'lib/load-me.rb', line 10

def self.add(*names)
  names.each do |dir|      
    path = get_path(dir)
    $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)      
  end
end

.relative_to(file, path) ⇒ Object



6
7
8
# File 'lib/load-me.rb', line 6

def self.relative_to(file, path)
  @base_path = File.join(File.dirname(file), path)    
end