-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
changelog.yml
117 lines (113 loc) · 4.38 KB
/
changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
- version: unreleased
summary:
date:
fixed:
added:
- 'Add a warning about deprecation of the gem (via #89) (@solnic)'
changed:
- version: 0.11.0
summary:
date: '2022-09-16'
fixed:
added:
changed:
- dry-configurable will be used whenever it is in the $LOAD_PATH (see dry-rb/dry-system#247
for more context) (@solnic)
- version: 0.10.1
summary:
date: '2022-07-29'
fixed:
added:
changed:
- 'Make `DidYouMean` integration optional (via #86) (@jbourassa)'
- version: 0.10.0
summary: "⚠️ 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."
date: '2022-07-10'
fixed:
added:
- 'Accept block given to `#merge` (via #83) (@timriley)'
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)'
- version: 0.9.0
date: '2021-09-12'
changed:
- "[internal] Upgraded to new `setting` API provided in dry-configurable 0.13.0
(@timriley in #77)"
- version: 0.8.0
date: '2021-06-06'
summary:
changed:
- "[BREAKING] Support for 2.4 and 2.5 was dropped"
- version: 0.7.2
date: '2019-07-09'
added:
- |-
`.resolve` accepts an optional fallback block, similar to how `Hash#fetch` works ([flash-gordon](https://github.com/flash-gordon))
```ruby
container.resolve('missing_key') { :fallback } # => :fallback
```
- |-
`.decorate` can (again) work with static values. Also, it can take a block instead of `with` ([flash-gordon](https://github.com/flash-gordon))
```ruby
container.register('key', 'value')
container.decorate('key') { |v| "<'#{v}'>" }
container.resolve('key') # => "<'value'>"
```
- version: 0.7.1
date: '2019-06-07'
fixed:
- Added `Mixin#dup` and `Mixin#clone`, now copies don't share underlying containers
(flash-gordon)
- version: 0.7.0
date: '2019-02-05'
changed:
- "[BREAKING] Now only Ruby 2.3 and above is supported ([flash-gordon](https://github.com/flash-gordon))"
fixed:
- Symbols are now coerced to strings when resolving stubbed dependencies ([cthulhu666](https://github.com/cthulhu666))
- |-
Stubbing keys not present in container will raise an error ([flash-gordon](https://github.com/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](https://github.com/dry-rb/dry-container/pull/47) ([yuszuv](https://github.com/yuszuv))
- |-
Registered objects can be decorated with the following API ([igor-alexandrov](https://github.com/igor-alexandrov))
```ruby
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](https://github.com/flash-gordon))
- "## Internal"
- Handling container items was generalized in [#34](https://github.com/dry-rb/dry-container/pull/34)
([GabrielMalakias](https://github.com/GabrielMalakias))
- version: 0.6.0
date: '2016-12-09'
added:
- "`Dry::Container::Mixin#each` - provides a means of seeing what all is registered
in the container ([jeremyf](https://github.com/jeremyf))"
fixed:
- Including mixin into a class with a custom initializer ([maltoe](https://github.com/maltoe))
- version: 0.5.0
date: '2016-08-31'
added:
- "`memoize` option to `#register` - memoizes items on first resolve ([ivoanjo](https://github.com/ivoanjo))"
fixed:
- "`required_ruby_version` set to `>= 2.0.0` ([artofhuman](https://github.com/artofhuman))"