Class: RubyProxy::ProxyLoad

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_proxy/proxy_load.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.load_pathObject

Returns the value of attribute load_path.



6
7
8
# File 'lib/ruby_proxy/proxy_load.rb', line 6

def load_path
  @load_path
end

Class Method Details

.loadObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ruby_proxy/proxy_load.rb', line 7

def load
  load_path.uniq.each do |p|
    if File.directory?(p)
      Dir[p.chomp("/") + "/*.rb"].each do |file|
        load_file(file)
      end
    else
      load_file(p)
    end
  end
end

.load_file(file) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/ruby_proxy/proxy_load.rb', line 19

def load_file(file)
  Logger.debug "require file : #{file}"
  require file
rescue LoadError=>e
  Logger.warn "require file : #{file} fail,exception:\n#{e}"
  raise 
end