Class: Dry::System::Rails::Container
- Inherits:
-
System::Container
- Object
- System::Container
- Dry::System::Rails::Container
- Defined in:
- lib/dry/system/rails/container.rb
Overview
Customized Container class for Rails application
Class Method Summary collapse
-
.auto_register!(dir, &block) ⇒ Object
Auto register files from the provided directory.
- .finalize!(options = {}) ⇒ Object private
-
.refresh_boot_files ⇒ Object
private
This is called when reloading in dev mode.
-
.require_path(path) ⇒ Object
private
Use ‘require_dependency` to make code reloading work.
Class Method Details
.auto_register!(dir, &block) ⇒ Object
Auto register files from the provided directory
18 19 20 21 22 23 24 25 26 |
# File 'lib/dry/system/rails/container.rb', line 18 def auto_register!(dir, &block) if block config.auto_register_configs << [dir, block] else config.auto_register << dir end self end |
.finalize!(options = {}) ⇒ 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.
29 30 31 32 33 34 |
# File 'lib/dry/system/rails/container.rb', line 29 def finalize!( = {}) config.auto_register_configs.each do |(dir, block)| auto_registrar.call(dir, &block) end super end |
.refresh_boot_files ⇒ 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.
This is called when reloading in dev mode
46 47 48 49 50 51 |
# File 'lib/dry/system/rails/container.rb', line 46 def refresh_boot_files booter.boot_files.each do |boot_file| load(boot_file) end self end |
.require_path(path) ⇒ 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.
Use ‘require_dependency` to make code reloading work
39 40 41 |
# File 'lib/dry/system/rails/container.rb', line 39 def require_path(path) require_dependency(path) end |