|
| 1 | +## v1.3.0 2017-03-05 |
| 2 | + |
| 3 | +### Added |
| 4 | +- No-undefined configuration of the initializer (nepalez, flash-gordon) |
| 5 | + |
| 6 | + You can either extend or include module `Dry::Initializer` with additional option |
| 7 | + `[undefined: false]`. This time `nil` will be assigned instead of |
| 8 | + `Dry::Initializer::UNDEFINED`. Readers becomes faster because there is no need |
| 9 | + to chech whether a variable was defined or not. At the same time the initializer |
| 10 | + doesn't distinct cases when a variable was set to `nil` explicitly, and when it wasn's set at all: |
| 11 | + |
| 12 | + class Foo # old behavior |
| 13 | + extend Dry::Initializer |
| 14 | + param :qux, optional: true |
| 15 | + end |
| 16 | + |
| 17 | + class Bar # new behavior |
| 18 | + extend Dry::Initializer[undefined: false] |
| 19 | + param :qux, optional: true |
| 20 | + end |
| 21 | + |
| 22 | + Foo.new.instance_variable_get(:@qux) # => Dry::Initializer::UNDEFINED |
| 23 | + Bar.new.instance_variable_get(:@qux) # => nil |
| 24 | + |
| 25 | +### Internals |
| 26 | +- Fixed method definitions for performance at the load time (nepalez, flash-gordon) |
| 27 | + |
| 28 | +[Compare v1.2.0...v1.3.0](https://github.com/dry-rb/dry-initializer/compare/v1.2.0...v1.3.0) |
| 29 | + |
1 | 30 | ## v1.2.0 2017-03-05
|
2 | 31 |
|
3 |
| -# Fixed |
| 32 | +### Fixed |
4 | 33 | - The `@__options__` variable collects renamed options after default values and coercions were applied (nepalez)
|
5 | 34 |
|
6 | 35 | [Compare v1.1.3...v1.2.0](https://github.com/dry-rb/dry-initializer/compare/v1.1.3...v1.2.0)
|
7 | 36 |
|
8 | 37 | ## v1.1.3 2017-03-01
|
9 | 38 |
|
10 |
| -# Added |
| 39 | +### Added |
11 | 40 | - Support for lambdas as default values (nepalez, gzigzigzeo)
|
12 | 41 |
|
13 | 42 | [Compare v1.1.2...v1.1.3](https://github.com/dry-rb/dry-initializer/compare/v1.1.2...v1.1.3)
|
14 | 43 |
|
15 | 44 | ## v1.1.2 2017-02-06
|
16 | 45 |
|
17 |
| -# Internals |
| 46 | +### Internals |
18 | 47 | - Remove previously defined methods before redefining them (flash-gordon)
|
19 | 48 |
|
20 | 49 | [Compare v1.1.1...v1.1.2](https://github.com/dry-rb/dry-initializer/compare/v1.1.1...v1.1.2)
|
21 | 50 |
|
22 | 51 | ## v1.1.1 2017-02-04
|
23 | 52 |
|
24 |
| -# Bugs Fixed |
| 53 | +### Bugs Fixed |
25 | 54 | - `@__options__` collects defined options only (nepalez)
|
26 | 55 |
|
27 | 56 | [Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-initializer/compare/v1.1.0...v1.1.1)
|
28 | 57 |
|
29 | 58 | ## v1.1.0 2017-01-28
|
30 | 59 |
|
31 |
| -# Added: |
| 60 | +### Added: |
32 | 61 | - enhancement via `Dry::Initializer::Attribute.dispatchers` registry (nepalez)
|
33 | 62 |
|
34 | 63 | # Register dispatcher for `:string` option
|
|
44 | 73 |
|
45 | 74 | User.new(:Andy).name # => "Andy"
|
46 | 75 |
|
47 |
| -# Internals: |
| 76 | +### Internals: |
48 | 77 | - optimize assignments for performance (nepalez)
|
49 | 78 |
|
50 | 79 | [Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-initializer/compare/v1.0.0...v1.1.0)
|
|
53 | 82 |
|
54 | 83 | In this version the code has been rewritten for simplicity
|
55 | 84 |
|
56 |
| -# BREAKING CHANGES |
| 85 | +### BREAKING CHANGES |
57 | 86 | - when `param` or `option` was not defined, the corresponding **variable** is set to `Dry::Initializer::UNDEFINED`, but the **reader** (when defined) will return `nil` (nepalez)
|
58 | 87 |
|
59 |
| -# Added: |
| 88 | +### Added: |
60 | 89 | - support for reloading `param` and `option` definitions (nepalez)
|
61 | 90 |
|
62 | 91 | class User
|
@@ -86,7 +115,7 @@ In this version the code has been rewritten for simplicity
|
86 | 115 | User.new(phone: '1234567890').phone # => '1234567890'
|
87 | 116 | User.new(number: '1234567890').phone # => '1234567890'
|
88 | 117 |
|
89 |
| -# Internals |
| 118 | +### Internals |
90 | 119 | - `Dry::Initializer` and `Dry::Initializer::Mixin` became aliases (nepalez)
|
91 | 120 |
|
92 | 121 | [Compare v0.11.0...v1.0.0](https://github.com/dry-rb/dry-initializer/compare/v0.11.0...v1.0.0)
|
|
0 commit comments