Skip to content

Commit

Permalink
zeitwerk
Browse files Browse the repository at this point in the history
  • Loading branch information
mensfeld committed Apr 30, 2019
1 parent 4331751 commit 3813b27
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/karafka/karafka
revision: 14dd2918d788a00262c70f94e714cf7939e89b7b
revision: 75d492e5386417232178c656d0c1248bc4e364a1
specs:
karafka (1.3.0)
dry-configurable (~> 0.8)
Expand All @@ -11,14 +11,14 @@ GIT
irb (~> 1.0)
multi_json (>= 1.12)
rake (>= 11.3)
require_all (>= 1.4)
ruby-kafka (>= 0.7.1)
thor (~> 0.20)
waterdrop (~> 1.3)
zeitwerk (~> 2.1)

GIT
remote: https://github.com/karafka/sidekiq-backend
revision: af24025f793fb89a713360b2cffb131d6b59ce04
revision: 47906bfb6f56f422246e549ad2063f7b77ff7719
specs:
karafka-sidekiq-backend (1.3.0)
activesupport (>= 4.0)
Expand All @@ -33,14 +33,15 @@ GIT

GIT
remote: https://github.com/karafka/waterdrop
revision: 7d17dc312b7abbf4d85b631e2e9f3a0f48d29b9f
revision: 971ed2d6f894ede2dc5552c22c52b5e2c02cbb1b
specs:
waterdrop (1.3.0)
delivery_boy (~> 0.2)
dry-configurable (~> 0.8)
dry-monitor (~> 0.3)
dry-validation (~> 0.11)
ruby-kafka (>= 0.7.1)
zeitwerk (~> 2.1)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -110,7 +111,6 @@ GEM
rack
rake (12.3.2)
redis (4.1.0)
require_all (2.0.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
Expand Down Expand Up @@ -140,6 +140,7 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
zeitwerk (2.1.5)

PLATFORMS
ruby
Expand Down
13 changes: 12 additions & 1 deletion karafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
ENV['RACK_ENV'] ||= 'development'
ENV['KARAFKA_ENV'] ||= ENV['RACK_ENV']
Bundler.require(:default, ENV['KARAFKA_ENV'])
Karafka::Loader.load(Karafka::App.root)

APP_LOADER = Zeitwerk::Loader.new

%w[
lib
app/consumers
app/responders
app/workers
].each(&APP_LOADER.method(:push_dir))

APP_LOADER.setup
APP_LOADER.eager_load

# App class
# @note The whole setup and routing could be placed in a single class definition
Expand Down

0 comments on commit 3813b27

Please sign in to comment.