Releases: dry-rb/dry-system
v0.10.0
0.10.0 - 2018-06-07
Added
-
You can now set a custom inflector on the container level. As a result, the
Loader
's constructor accepts two arguments:path
andinflector
, update your custom loaders accordingly (flash-gordon)class MyContainer < Dry::System::Container configure do |config| config.inflector = Dry::Inflector.new do |inflections| inflections.acronym('API') end end end
Changed
- A helpful error will be raised if an invalid setting value is provided (GustavoCaso)
- When using setting plugin, will use default values from types (GustavoCaso)
- Minimal supported ruby version was bumped to
2.3
(flash-gordon) dry-struct
was updated to~> 0.5
(flash-gordon)
0.9.2
Fixed
- Default namespace no longer breaks resolving dependencies with identifier that includes part of the namespace (ie
mail.mailer
) (GustavoCaso)
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)