From c36752978e7b1622675e9cdcd0405479fcb7b6a0 Mon Sep 17 00:00:00 2001 From: Luiz Eduardo Kowalski Date: Thu, 10 Aug 2023 23:32:00 +0200 Subject: [PATCH] Zeitwerk (#36) --- concurrent_rails.gemspec | 1 + lib/concurrent_rails.rb | 9 +++------ lib/concurrent_rails/promises.rb | 3 --- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/concurrent_rails.gemspec b/concurrent_rails.gemspec index 72ca5b2..77c61c8 100644 --- a/concurrent_rails.gemspec +++ b/concurrent_rails.gemspec @@ -18,6 +18,7 @@ Gem::Specification.new do |spec| spec.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] spec.add_dependency "railties", ">= 6.0" + spec.add_dependency "zeitwerk", "~> 2.6" spec.required_ruby_version = ">= 3.0" spec.metadata = { diff --git a/lib/concurrent_rails.rb b/lib/concurrent_rails.rb index 4adf956..71a9305 100644 --- a/lib/concurrent_rails.rb +++ b/lib/concurrent_rails.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require "concurrent_rails/future" -require "concurrent_rails/multi" -require "concurrent_rails/promises" -require "concurrent_rails/railtie" -require "concurrent_rails/testing" -require "concurrent_rails/version" +require "zeitwerk" +loader = Zeitwerk::Loader.for_gem +loader.setup diff --git a/lib/concurrent_rails/promises.rb b/lib/concurrent_rails/promises.rb index 6cf3275..3b0b817 100644 --- a/lib/concurrent_rails/promises.rb +++ b/lib/concurrent_rails/promises.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require "concurrent_rails/future_adapter" -require "concurrent_rails/delay_adapter" - module ConcurrentRails class Promises include Concurrent::Promises::FactoryMethods