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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d76fbe81b58bc0a6d0e5abb5f135e32e6eb7f47533af60864a09e0143b3ea66c
4
- data.tar.gz: 33f74bd69c1f030477088d32e80024969983e8dd793c58c89264828edc207a90
3
+ metadata.gz: 102cb0a4fe42ebde6835f50b7e75826dbc4b98c78cca9fcee5c5863c1c47651f
4
+ data.tar.gz: f5da17ecfb79edfa42c0d6c9a0d05d3e4cce2297533ec3151afafc9e6d4151b3
5
5
  SHA512:
6
- metadata.gz: aef6696e55e9ec56e46fabc857db9f1c2c8e266efad943844faf574d2d7d224829ca14457f66c8082f016d4cbdcb7f6bc9a1f33f641c743621c3b998d2f604d4
7
- data.tar.gz: 11ab00f69b7c172d23d6de19a2f0a208bbd83ecd91b865cb591d18df0f91fd4578d487fb2acd71a88e4b89477a17e602816999847cad4fc0671139aa68e11d00
6
+ metadata.gz: 7d6dac8ebf7eddf6eb8b61da5cef0a434769270fc5ad2ab13ea7a4c5d093c047681b1bc85da4ba09190cfcf17ef023293dc4ccdb2f8dd2ac7eae19dbb4c69706
7
+ data.tar.gz: be0be051c79c2ef527d678cb9f839d6cabf40669b19864d38a735fe428a277068504897bd289baf69e0da26f470e35e0c2e73bc99f62dd16286fa7148a35572c
@@ -1,4 +1,20 @@
1
- ## unreleased
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...master](https://github.com/dry-rb/dry-configurable/compare/v0.11.5...master)
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
@@ -21,7 +21,7 @@
21
21
 
22
22
  This library officially supports the following Ruby versions:
23
23
 
24
- * MRI >= `2.4`
24
+ * MRI >= `2.5`
25
25
  * jruby >= `9.2`
26
26
 
27
27
  ## License
@@ -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.4.0"
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.4", ">= 0.4.7"
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"
@@ -57,7 +57,7 @@ module Dry
57
57
  super
58
58
  klass.class_eval do
59
59
  extend(ClassMethods)
60
- include(InstanceMethods)
60
+ prepend(InstanceMethods)
61
61
 
62
62
  class << self
63
63
  undef :config
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'concurrent/map'
4
4
 
5
- require 'dry/equalizer'
5
+ require 'dry/core/equalizer'
6
6
 
7
7
  require 'dry/configurable/constants'
8
8
  require 'dry/configurable/errors'
@@ -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.equal?(Undefined) ? default : 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
- @value = source.value.dup if source.input_defined? && source.clonable_value?
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[input.equal?(Undefined) ? nil : input]
130
+ @value = constructor[Undefined.coalesce(input, default, nil)]
129
131
  end
130
132
  end
131
133
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'concurrent/map'
4
4
 
5
- require 'dry/equalizer'
5
+ require 'dry/core/equalizer'
6
6
  require 'dry/configurable/constants'
7
7
 
8
8
  module Dry
@@ -3,6 +3,6 @@
3
3
  module Dry
4
4
  module Configurable
5
5
  # @api public
6
- VERSION = '0.11.6'
6
+ VERSION = '0.12.0'
7
7
  end
8
8
  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.11.6
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-06-22 00:00:00.000000000 Z
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.4'
33
+ version: '0.5'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 0.4.7
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.4'
43
+ version: '0.5'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.4.7
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.4.0
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.0.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