Method: Earth::Loader.require_glob

Defined in:
lib/earth/loader.rb

.require_glob(glob, options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/earth/loader.rb', line 20

def Loader.require_glob(glob, options = {})
  @require_glob ||= []
  args = [glob, options]
  return if @require_glob.include?(args)
  @require_glob << args
  require_later = []
  ::Dir[glob].each do |path|
    # ugh
    if path.include?('data_miner') or path.include?('parser')
      require_later << path
    else
      require path
    end
  end
  # load data_miner blocks second to make sure they override
  require_later.each do |path|
    require path
  end if options[:load_data_miner] || options[:mine_original_sources]
  nil
end