# 0.4.4 / 2017-09-14 ### Added - Determine name for dependencies by splitting identifiers on any invalid local variable name characters (e.g. "/", "?", "!"), instead of splitting on dots only (raventid in [#39](https://github.com/dry-rb/dry-auto_inject/pull/39)) # 0.4.3 / 2017-05-27 ### Added - Push sequential arguments along with keywords in the kwargs strategy (hbda + vladra in [#32](https://github.com/dry-rb/dry-auto_inject/pull/32)) [Compare v0.4.2...v0.4.3](https://github.com/dryrb/dry-auto_inject/compare/v0.4.2...v0.4.3) # 0.4.2 / 2016-10-10 ### Fixed - Fixed issue where injectors for different containers could not be used on different classes in an inheritance hierarchy (timriley in [#31](https://github.com/dry-rb/dry-auto_inject/pull/31)) [Compare v0.4.1...v0.4.2](https://github.com/dryrb/dry-auto_inject/compare/v0.4.1...v0.4.2) # 0.4.1 / 2016-08-14 ### Changed - Loosened version dependency on dry-container (AMHOL) [Compare v0.4.0...v0.4.1](https://github.com/dryrb/dry-auto_inject/compare/v0.4.0...v0.4.1) # 0.4.0 / 2016-07-26 ### Added - Support for strategy chaining, which is helpful in opting for alternatives to an application's normal strategy (timriley in [#25](https://github.com/dry-rb/dry-auto_inject/pull/25)) ```ruby # Define the application's injector with a non-default MyInject = Dry::AutoInject(MyContainer).hash # Opt for a different strategy in a particular class class MyClass include MyInject.args["foo"] end # You can chain as long as you want (silly example to demonstrate the flexibility) class OtherClass include MyInject.args.hash.kwargs.args["foo"] end ``` ### Changed - Use a `BasicObject`-based environment for the injector builder API instead of the previous `define_singleton_method`-based approach, which had negative performance characteristics (timriley in [#26](https://github.com/dry-rb/dry-auto_inject/pull/26)) ### Fixed - Fixed issue with kwargs injectors used at multiple points in a class inheritance heirarchy (flash-gordon in [#27](https://github.com/dry-rb/dry-auto_inject/pull/27)) [Compare v0.3.0...v0.4.0](https://github.com/dryrb/dry-auto_inject/compare/v0.3.0...v0.4.0) # 0.3.0, 2016-06-02 ### Added * Support for new `kwargs` and `hash` injection strategies These strategies can be accessed via methods on the main builder object: ```ruby MyInject = Dry::AutoInject(my_container) class MyClass include MyInject.hash["my_dep"] end ``` * Support for user-provided injection strategies All injection strategies are now held in their own `Dry::AutoInject::Strategies` container. You can add register your own strategies to this container, or choose to provide a strategies container of your own: ```ruby class CustomStrategy < Module # Your strategy code goes here :) end # Registering your own strategy (globally) Dry::AutoInject::Strategies.register :custom, CustomStrategy MyInject = Dry::AutoInject(my_container) class MyClass include MyInject.custom["my_dep"] end # Providing your own container (keeping the existing strategies in place) class MyStrategies < Dry::AutoInject::Strategies register :custom, CustomStrategy end MyInject = Dry::AutoInject(my_container, strategies: MyStrategies) class MyClass include MyInject.custom["my_dep"] end # Proiding a completely separated container class MyStrategies extend Dry::Container::Mixin register :custom, CustomStrategy end MyInject = Dry::AutoInject(my_container, strategies: MyStrategies) class MyClass include MyInject.custom["my_dep"] end ``` * User-specified aliases for dependencies These aliases enable you to specify your own name for dependencies, both for their local readers and their keys in the kwargs- and hash-based initializers. Specify aliases by passing a hash of names: ```ruby MyInject = Dry::AutoInject(my_container) class MyClass include MyInject[my_dep: "some_other.dep"] # Refer to the dependency as `my_dep` inside the class end # Pass your own replacements using the `my_dep` initializer key my_obj = MyClass.new(my_dep: something_else) ``` A mix of both regular and aliased dependencies can also be injected: ```ruby include MyInject["some_dep", another_dep: "some_other.dep"] ``` * Inspect the `super` method of the including class’s `#initialize` and send it arguments that will match its own arguments list/arity. This allows auto_inject to be used more easily in existing class inheritance heirarchies. ### Changed * `kwargs` is the new default injection strategy * Rubinius support is not available for the `kwargs` strategy (see [#18](https://github.com/dry-rb/dry-auto_inject/issues/18)) [Compare v0.2.0...v0.3.0](https://github.com/dryrb/dry-auto_inject/compare/v0.2.0...v0.3.0) # v0.2.0 2016-02-09 ### Added * Support for hashes as constructor arguments via `Import.hash` interface (solnic) [Compare v0.1.0...v0.2.0](https://github.com/dryrb/dry-auto_inject/compare/v0.1.0...v0.2.0) # v0.1.0 2015-11-12 Changed interface from `Dry::AutoInject.new { container(some_container) }` to `Dry::AutoInject(some_container)`. # v0.0.1 2015-08-20 First public release \o/