lib/dry/rails/container.rb in dry-rails-0.4.0 vs lib/dry/rails/container.rb in dry-rails-0.5.0

- old
+ new

@@ -1,11 +1,11 @@ # frozen_string_literal: true require "rails/version" require "dry/system/container" -require "dry/system/components" +require "dry/system/provider_sources" require "dry/rails/auto_registrars/app" module Dry module Rails @@ -57,19 +57,17 @@ # The railtie has a rails-specific auto-registrar which is app-dir aware config.auto_registrar = Rails::AutoRegistrars::App class << self - # Return if a given component was booted + # Return if a given component was started # # @return [Boolean] # # @api private - # - # TODO: this should be moved to dry-system - def booted?(name) - booter.booted.map(&:name).include?(name) + def started?(name) + providers[name].started? end # TODO: confirm that this is really needed if ::Rails.version.start_with?("5") # @api private @@ -81,12 +79,12 @@ # This is called when reloading in dev mode # # @return [self] # # @api private - def refresh_boot_files - booter.boot_files.each do |boot_file| - load(boot_file) + def refresh_provider_files + providers.provider_files.each do |boot_file| + ::Kernel.load(boot_file) end self end end end