Releases: dry-rb/dry-system
0.8.1
Fixed
- Aliasing an external component works correctly (solnic)
- Manually calling
:init
will also finalize a component (solnic)
0.8.0
Added
- Support for external bootable components (solnic)
- Built-in
:system
components including:settings
component (solnic)
Fixed
- Lazy-loading components work when a container has
default_namespace
configured (GustavoCaso)
Changed
- [BREAKING] Improved boot DSL with support for namespacing and lifecycle before/after callbacks (solnic)
0.7.3
0.7.2
Added
Container.enable_stubs!
for test environments which enables stubbing components (GustavoCaso)
Changed
- Component identifiers can now include same name more than once ie
foo.stuff.foo
(GustavoCaso) Container#boot!
was renamed toContainer#start
(davydovanton)Container#boot
was renamed toContainer#init
(davydovanton)
0.7.1
0.7.0
Added
-
Added
manual_registrar
container setting (along with defaultManualRegistrar
implementation), andregistrations_dir
setting. These provide support for a well-established place for keeping files with manual container registrations (timriley) -
AutoRegistrar parses initial lines of Ruby source files for "magic comments" when auto-registering components. An
# auto_register: false
magic comment will prevent a Ruby file from being auto-registered (timriley) -
Container.auto_register!
, when called with a block, yields a configuration object to control the auto-registration behavior for that path, with support for configuring 2 different aspects of auto-registration behavior (both optional):class MyContainer < Dry::System::Container auto_register!('lib') do |config| config.instance do |component| # custom logic for initializing a component end config.exclude do |component| # return true to skip auto-registration of the component, e.g. # component.path =~ /entities/ end end end
-
A helpful error will be raised if a bootable component's finalize block name doesn't match its boot file name (GustavoCaso)
Changed
- The
default_namespace
container setting now supports multi-level namespaces (GustavoCaso) Container.auto_register!
yields a configuration block instead of a block for returning a custom instance (see above) (GustavoCaso)Container.import
now requires an explicit local name for the imported container (e.g.import(local_name: AnotherContainer)
) (timriley)