lib/dry/rails/railtie.rb in dry-rails-0.4.0 vs lib/dry/rails/railtie.rb in dry-rails-0.5.0
- old
+ new
@@ -32,12 +32,11 @@
root_path = ::Rails.root
container = Dry::Rails.create_container(
root: root_path,
inflector: default_inflector,
- system_dir: root_path.join("config/system"),
- bootable_dirs: [root_path.join("config/system/boot")]
+ provider_dirs: [root_path.join("config/system/boot")]
)
# Enable :env plugin by default because it is a very common requirement
container.use :env, inferrer: -> { ::Rails.env }
@@ -55,14 +54,14 @@
set_or_reload(container.container_constant, container)
set_or_reload(container.auto_inject_constant, container.injector)
container.features.each do |feature|
- container.boot(feature, from: :rails)
+ container.register_provider(feature, from: :rails)
end
- container.refresh_boot_files if reloading?
+ container.refresh_provider_files if reloading?
container.finalize!(freeze: !::Rails.env.test?)
end
# rubocop:enable Metrics/AbcSize
alias_method :reload, :finalize!
@@ -74,10 +73,10 @@
# lifecycle step
#
# @api public
def stop_features
container.features.each do |feature|
- container.stop(feature) if container.booted?(feature)
+ container.stop(feature) if container.started?(feature)
end
end
# Exposes the container constant
#