lib/dry/system/components/bootable.rb in dry-system-0.17.0 vs lib/dry/system/components/bootable.rb in dry-system-0.18.0
- old
+ new
@@ -1,11 +1,11 @@
# frozen_string_literal: true
-require 'dry/system/lifecycle'
-require 'dry/system/settings'
-require 'dry/system/components/config'
-require 'dry/system/constants'
+require "dry/system/lifecycle"
+require "dry/system/settings"
+require "dry/system/components/config"
+require "dry/system/constants"
module Dry
module System
module Components
# Bootable components can provide one or more objects and typically depend
@@ -68,11 +68,11 @@
# @api private
def initialize(identifier, options = {}, &block)
@config = nil
@config_block = nil
@identifier = identifier
- @triggers = { before: TRIGGER_MAP.dup, after: TRIGGER_MAP.dup }
+ @triggers = {before: TRIGGER_MAP.dup, after: TRIGGER_MAP.dup}
@options = block ? options.merge(block: block) : options
@namespace = options[:namespace]
finalize = options[:finalize] || DEFAULT_FINALIZE
instance_exec(&finalize)
end
@@ -227,39 +227,11 @@
# Return true
#
# @return [TrueClass]
#
# @api private
- def boot?
+ def bootable?
true
- end
-
- # Return path to component's boot file
- #
- # @return [String]
- #
- # @api private
- def boot_file
- container_boot_files
- .detect { |path| Pathname(path).basename(RB_EXT).to_s == identifier.to_s }
- end
-
- # Return path to boot dir
- #
- # @return [String]
- #
- # @api private
- def boot_path
- container.boot_path
- end
-
- # Return all boot files defined under container's boot path
- #
- # @return [String]
- #
- # @api private
- def container_boot_files
- ::Dir[container.boot_path.join("**/#{RB_GLOB}")].sort
end
private
# Return lifecycle object used for this component