Method: Configuration::ClassMethods#load

Defined in:
lib/configuration.rb

#load(name) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/configuration.rb', line 47

def load name
  name = name.to_s
  name = name + '.rb' unless name[%r/\.rb$/]
  key = name.sub %r/\.rb$/, ''
  load_path = $LOAD_PATH.dup
  begin
    $LOAD_PATH.replace(path + load_path)
    ::Kernel.load name
  ensure
    $LOAD_PATH.replace load_path
  end
  Table[key]
end