Class: Dry::System::Plugins::Zeitwerk Private

Inherits:
Module
  • Object
show all
Defined in:
lib/dry/system/plugins/zeitwerk.rb,
lib/dry/system/plugins/zeitwerk/compat_inflector.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: CompatInflector

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(loader: nil, run_setup: true, eager_load: nil, debug: false) ⇒ Zeitwerk

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Zeitwerk.



23
24
25
26
27
28
29
# File 'lib/dry/system/plugins/zeitwerk.rb', line 23

def initialize(loader: nil, run_setup: true, eager_load: nil, debug: false)
  @loader = loader || ::Zeitwerk::Loader.new
  @run_setup = run_setup
  @eager_load = eager_load
  @debug = debug
  super()
end

Instance Attribute Details

#debugObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/dry/system/plugins/zeitwerk.rb', line 20

def debug
  @debug
end

#eager_loadObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/dry/system/plugins/zeitwerk.rb', line 20

def eager_load
  @eager_load
end

#loaderObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/dry/system/plugins/zeitwerk.rb', line 20

def loader
  @loader
end

#run_setupObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/dry/system/plugins/zeitwerk.rb', line 20

def run_setup
  @run_setup
end

Class Method Details

.dependenciesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
14
15
16
17
# File 'lib/dry/system/plugins/zeitwerk.rb', line 11

def self.dependencies
  [
    "dry/system/loader/autoloading",
    "dry/system/plugins/zeitwerk/compat_inflector",
    {"zeitwerk" => "zeitwerk"}
  ]
end

Instance Method Details

#extended(system) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/dry/system/plugins/zeitwerk.rb', line 32

def extended(system)
  system.setting :autoloader, reader: true

  system.config.autoloader = loader
  system.config.component_dirs.loader = Dry::System::Loader::Autoloading
  system.config.component_dirs.add_to_load_path = false

  system.after(:configure, &method(:setup_autoloader))

  super
end