lib/dry/system/booter.rb in dry-system-0.10.0 vs lib/dry/system/booter.rb in dry-system-0.10.1
- old
+ new
@@ -95,9 +95,18 @@
self
end
end
# @api private
+ def stop(name_or_component)
+ call(name_or_component) do |component|
+ raise ComponentNotStartedError.new(name_or_component) unless booted.include?(component)
+ component.stop
+ yield if block_given?
+ end
+ end
+
+ # @api private
def call(name_or_component)
with_component(name_or_component) do |component|
unless component
raise ComponentFileMismatchError.new(name, registered_booted_keys)
end