lib/dry/system/container.rb in dry-system-0.10.0 vs lib/dry/system/container.rb in dry-system-0.10.1
- old
+ new
@@ -339,10 +339,25 @@
def init(name)
booter.init(name)
self
end
+ # Stop a specific component but calls only `stop` lifecycle trigger
+ #
+ # @example
+ # MyApp.stop(:persistence)
+ #
+ # @param [Symbol] name The name of a registered bootable component
+ #
+ # @return [self]
+ #
+ # @api public
+ def stop(name)
+ booter.stop(name)
+ self
+ end
+
# Sets load paths relative to the container's root dir
#
# @example
# class MyApp < Dry::System::Container
# configure do |config|
@@ -558,10 +573,12 @@
if (bootable_dep = component(root_key)).boot?
booter.start(bootable_dep)
elsif importer.key?(root_key)
load_imported_component(component.namespaced(root_key))
- else
+ end
+
+ if !key?(key)
load_local_component(component)
end
end
end