core-state 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/core/state/version.rb +1 -1
- data/lib/is/stateful.rb +4 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db495761cd564d756fb99e985b29d4e8176c532d605724a321670cfa8888e4b9
|
4
|
+
data.tar.gz: 96f7b2337e73e82a7ea5735a98e7b6a7055b9098656248e4c658584d5eb074b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe3dfb3399854e9ffd96cd257b195b545cd31cda25d95db4af6be40c17890653322a015881672c75df64d4a451d4c11cf7004b90aa62cb83937d29de90d1ea9a
|
7
|
+
data.tar.gz: 229caf7f8a616ed01498420f688f6c8366663684791be54581e074836f035d52c1cd5d2123c953da2ac861bbf703984b0324fbbbd2d0b4142989cb20a4175c7d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## [v0.1.5](https://github.com/metabahn/corerb/releases/tag/2021-10-22)
|
2
|
+
|
3
|
+
*released on 2021-10-22*
|
4
|
+
|
5
|
+
* `fix` [#88](https://github.com/metabahn/corerb/pull/88) Fix an issue causing state to be shared between sibling subclasses ([bryanp](https://github.com/bryanp))
|
6
|
+
|
1
7
|
## [v0.1.4](https://github.com/metabahn/corerb/releases/tag/2021-09-30)
|
2
8
|
|
3
9
|
*released on 2021-09-30*
|
data/lib/core/state/version.rb
CHANGED
data/lib/is/stateful.rb
CHANGED
@@ -7,14 +7,12 @@ module Is
|
|
7
7
|
# [public] Makes objects stateful.
|
8
8
|
#
|
9
9
|
module Stateful
|
10
|
-
# Adding core-copy as a dependency
|
10
|
+
# Adding core-copy as a dependency creates a recursive dependency, so just bundle it.
|
11
11
|
#
|
12
12
|
module Copy
|
13
13
|
DEFAULT = ::Object.new
|
14
14
|
|
15
15
|
refine ::Object do
|
16
|
-
# [public] Copies the object using `clone`.
|
17
|
-
#
|
18
16
|
if RbConfig::CONFIG["RUBY_PROGRAM_VERSION"] < "3"
|
19
17
|
def copy(freeze: DEFAULT)
|
20
18
|
should_freeze = resolve_freeze_argument(freeze)
|
@@ -40,8 +38,6 @@ module Is
|
|
40
38
|
end
|
41
39
|
|
42
40
|
refine Array do
|
43
|
-
# [public] Copies the array, along with each value.
|
44
|
-
#
|
45
41
|
def copy(freeze: DEFAULT)
|
46
42
|
unless Stateful.copying?(self)
|
47
43
|
Stateful.prevent_recursion(self) do
|
@@ -58,8 +54,6 @@ module Is
|
|
58
54
|
end
|
59
55
|
|
60
56
|
refine Hash do
|
61
|
-
# [public] Copies the hash, along with each key and value.
|
62
|
-
#
|
63
57
|
def copy(freeze: DEFAULT)
|
64
58
|
unless Stateful.copying?(self)
|
65
59
|
Stateful.prevent_recursion(self) do
|
@@ -192,7 +186,9 @@ module Is
|
|
192
186
|
end
|
193
187
|
|
194
188
|
subclass.send(:prepend_defined_state_modules)
|
195
|
-
subclass.instance_variable_set("@__defined_state", @__defined_state.
|
189
|
+
subclass.instance_variable_set("@__defined_state", @__defined_state.each_with_object({}) { |(key, value), state|
|
190
|
+
state[key] = value.dup
|
191
|
+
})
|
196
192
|
|
197
193
|
super
|
198
194
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core-state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: core-extension
|