dry-configurable 0.11.6 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -2
- data/README.md +1 -1
- data/dry-configurable.gemspec +2 -3
- data/lib/dry/configurable.rb +1 -1
- data/lib/dry/configurable/config.rb +1 -1
- data/lib/dry/configurable/setting.rb +11 -9
- data/lib/dry/configurable/settings.rb +1 -1
- data/lib/dry/configurable/version.rb +1 -1
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 102cb0a4fe42ebde6835f50b7e75826dbc4b98c78cca9fcee5c5863c1c47651f
|
4
|
+
data.tar.gz: f5da17ecfb79edfa42c0d6c9a0d05d3e4cce2297533ec3151afafc9e6d4151b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d6dac8ebf7eddf6eb8b61da5cef0a434769270fc5ad2ab13ea7a4c5d093c047681b1bc85da4ba09190cfcf17ef023293dc4ccdb2f8dd2ac7eae19dbb4c69706
|
7
|
+
data.tar.gz: be0be051c79c2ef527d678cb9f839d6cabf40669b19864d38a735fe428a277068504897bd289baf69e0da26f470e35e0c2e73bc99f62dd16286fa7148a35572c
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,20 @@
|
|
1
|
-
|
1
|
+
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
|
+
|
3
|
+
## 0.12.0 2020-12-26
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Setting values provided by defaults and/or pre-processor blocks are no longer accidentally memoized across instances of classes including Dry::Configurable (#99) (@timriley & @esparta)
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
|
12
|
+
- Instance behavior is now prepended, so that if you have your own `initialize`, calling `super` is no longer required (see #98 for more details) (@zabolotnov87)
|
13
|
+
- Switched to equalizer from dry-core (@solnic)
|
14
|
+
|
15
|
+
[Compare v0.11.6...v0.12.0](https://github.com/dry-rb/dry-configurable/compare/v0.11.6...v0.12.0)
|
16
|
+
|
17
|
+
## 0.11.6 2020-06-22
|
2
18
|
|
3
19
|
|
4
20
|
### Changed
|
@@ -6,7 +22,7 @@
|
|
6
22
|
- A meaningful error is raised when the extension is included more than once (issue #89 fixed via #94) (@landongrindheim)
|
7
23
|
- Evaluate setting input immediately when input is provided. This allows for earlier feedback from constructors designed to raise errors on invalid input (#95) (@timriley)
|
8
24
|
|
9
|
-
[Compare v0.11.5...
|
25
|
+
[Compare v0.11.5...v0.11.6](https://github.com/dry-rb/dry-configurable/compare/v0.11.5...v0.11.6)
|
10
26
|
|
11
27
|
## 0.11.5 2020-03-23
|
12
28
|
|
data/README.md
CHANGED
data/dry-configurable.gemspec
CHANGED
@@ -25,12 +25,11 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-configurable'
|
26
26
|
spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-configurable/issues'
|
27
27
|
|
28
|
-
spec.required_ruby_version = ">= 2.
|
28
|
+
spec.required_ruby_version = ">= 2.5.0"
|
29
29
|
|
30
30
|
# to update dependencies edit project.yml
|
31
31
|
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
32
|
-
spec.add_runtime_dependency "dry-core", "~> 0.
|
33
|
-
spec.add_runtime_dependency "dry-equalizer", "~> 0.2"
|
32
|
+
spec.add_runtime_dependency "dry-core", "~> 0.5", ">= 0.5.0"
|
34
33
|
|
35
34
|
spec.add_development_dependency "bundler"
|
36
35
|
spec.add_development_dependency "rake"
|
data/lib/dry/configurable.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'set'
|
4
4
|
|
5
|
-
require 'dry/equalizer'
|
5
|
+
require 'dry/core/equalizer'
|
6
6
|
|
7
7
|
require 'dry/configurable/constants'
|
8
8
|
require 'dry/configurable/config'
|
@@ -53,11 +53,16 @@ module Dry
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
# @api private
|
57
|
+
def self.clonable_value?(value)
|
58
|
+
CLONABLE_VALUE_TYPES.any? { |type| value.is_a?(type) }
|
59
|
+
end
|
60
|
+
|
56
61
|
# @api private
|
57
62
|
def initialize(name, input: Undefined, default: Undefined, **options)
|
58
63
|
@name = name
|
59
64
|
@writer_name = :"#{name}="
|
60
|
-
@input = input
|
65
|
+
@input = input
|
61
66
|
@default = default
|
62
67
|
@options = options
|
63
68
|
|
@@ -109,23 +114,20 @@ module Dry
|
|
109
114
|
writer_name.equal?(meth)
|
110
115
|
end
|
111
116
|
|
112
|
-
# @api private
|
113
|
-
def clonable_value?
|
114
|
-
CLONABLE_VALUE_TYPES.any? { |type| value.is_a?(type) }
|
115
|
-
end
|
116
|
-
|
117
117
|
private
|
118
118
|
|
119
119
|
# @api private
|
120
120
|
def initialize_copy(source)
|
121
121
|
super
|
122
|
-
@
|
122
|
+
@input = source.input.dup if Setting.clonable_value?(source.input)
|
123
|
+
@default = source.default.dup if Setting.clonable_value?(source.default)
|
124
|
+
@value = source.value.dup if source.evaluated? && Setting.clonable_value?(source.value)
|
123
125
|
@options = source.options.dup
|
124
126
|
end
|
125
127
|
|
126
128
|
# @api private
|
127
129
|
def evaluate
|
128
|
-
@value = constructor[
|
130
|
+
@value = constructor[Undefined.coalesce(input, default, nil)]
|
129
131
|
end
|
130
132
|
end
|
131
133
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-configurable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Holland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -30,34 +30,20 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.5'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.
|
36
|
+
version: 0.5.0
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
43
|
+
version: '0.5'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: dry-equalizer
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0.2'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0.2'
|
46
|
+
version: 0.5.0
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: bundler
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
142
128
|
requirements:
|
143
129
|
- - ">="
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: 2.
|
131
|
+
version: 2.5.0
|
146
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
133
|
requirements:
|
148
134
|
- - ">="
|
149
135
|
- !ruby/object:Gem::Version
|
150
136
|
version: '0'
|
151
137
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
138
|
+
rubygems_version: 3.1.4
|
153
139
|
signing_key:
|
154
140
|
specification_version: 4
|
155
141
|
summary: A mixin to add configuration functionality to your classes
|