Module: Karafka::Loader
- Defined in:
- lib/karafka/loader.rb
Overview
Loader for requiring all the files in a proper order
Constant Summary collapse
- DIRS =
Order in which we want to load app files
%w[ lib app ].freeze
Class Method Summary collapse
-
.load(root) ⇒ Object
Will load files in a proper order (based on DIRS).
-
.load!(path) ⇒ Object
Requires all the ruby files from one path in a proper order.
Class Method Details
.load(root) ⇒ Object
Will load files in a proper order (based on DIRS)
14 15 16 17 18 19 20 |
# File 'lib/karafka/loader.rb', line 14 def self.load(root) DIRS.each do |dir| path = File.join(root, dir) next unless File.exist?(path) load!(path) end end |
.load!(path) ⇒ Object
Requires all the ruby files from one path in a proper order
24 25 26 |
# File 'lib/karafka/loader.rb', line 24 def self.load!(path) require_all(path) end |