Skip to content

Releases: dry-rb/dry-container

v0.11.0

16 Sep 08:47
v0.11.0
eff66c2
Compare
Choose a tag to compare

Changed

Compare v0.10.1...v0.11.0

v0.10.1

29 Jul 06:27
v0.10.1
Compare
Choose a tag to compare

Changed

Compare v0.10.0...v0.10.1

v0.10.0

10 Jul 09:49
v0.10.0
Compare
Choose a tag to compare

⚠️ Notice that dry-container no longer depends on dry-configurable. If you happen to rely on the advanced configurable functionality, add dry-configurable as a dependency and require it before requiring dry-container.

Added

Changed

  • [BREAKING] Replace dep on dry-configurable with a simple Configuration mod (see #84 for more details) (@solnic)
  • Raise KeyError for missing key, with DidYouMean integration (via #82) (@cllns)
  • Wrap FrozenError, to state that the container itself is frozen (see #74) (@cllns)

Compare v0.9.0...v0.10.0

v0.9.0

12 Sep 12:31
Compare
Choose a tag to compare

Changed

  • [internal] Upgraded to new setting API provided in dry-configurable 0.13.0 (@timriley in #77)

Compare v0.8.0...v0.9.0

v0.8.0

06 Jun 11:43
v0.8.0
c9184e4
Compare
Choose a tag to compare

Changed

  • [BREAKING] Support for 2.4 and 2.5 was dropped

Compare v0.7.2...v0.8.0

v0.7.2

09 Jul 15:33
v0.7.2
13d4136
Compare
Choose a tag to compare

v0.7.2 - 2019-07-09

Added

  • .resolve accepts an optional fallback block, similar to how Hash#fetch works (flash-gordon)
    container.resolve('missing_key') { :fallback } # => :fallback
  • .decorate can (again) work with static values. Also, it can take a block instead of with (flash-gordon)
    container.register('key', 'value')
    container.decorate('key') { |v| "<'#{v}'>" }
    container.resolve('key') # => "<'value'>"

Compare v0.7.1...0.7.2

v0.7.1

07 Jun 09:42
v0.7.1
0175395
Compare
Choose a tag to compare

v0.7.1 - 2019-06-07

Fixed

  • Added Mixin#dup and Mixin#clone, now copies don't share underlying containers (flash-gordon)

Compare v0.7.0...0.7.1

v0.7.0

05 Feb 09:58
v0.7.0
1e6a888
Compare
Choose a tag to compare

v0.7.0 - 2019-02-05

Changed

  • [BREAKING] Now only Ruby 2.3 and above is supported (flash-gordon)

Fixed

  • Symbols are now coerced to strings when resolving stubbed dependencies (cthulhu666)

  • Stubbing keys not present in container will raise an error (flash-gordon)

    This means after upgrading you may see errors like this

    ArgumentError (cannot stub "something" - no such key in container)
    

    Be sure you register dependencies before using them. The new behavior will likely save quite a bit of time when debugging ill-configured container setups.

Added

  • Namespace DSL resolves keys relative to the current namespace, see the corresponding changes (yuszuv)

  • Registered objects can be decorated with the following API (igor-alexandrov)

    class CreateUser
      def call(params)
        # ...
      end
    end
    container.register('create_user') { CreateUser.new }
    container.decorate('create_user', with: ShinyLogger.new)
    
    # Now subsequent resolutions will return a wrapped object
    
    container.resolve('create_user')
    # => #<ShinyLogger @obj=#<CreateUser:0x...>]>
  • Freezing a container now prevents further registrations (flash-gordon)

Internal

Compare v0.6.0...0.7.0