core-global 0.1.2 → 0.2.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 +7 -0
- data/lib/core/global/version.rb +1 -1
- data/lib/is/global.rb +9 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5554989b8d85210df257092029af21aa849ac4a516f43d61ae59ddef316a4d06
|
4
|
+
data.tar.gz: c7b130dfe7f952c7806b4f25e89ac3bf1f0a70266cd23b31d05ff7b5997ee8a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d90bd2e5233c0264f374a9592ee58b2cc8950a99ac8a033108460ed4c06024fef0a4c2f6bfcf46e2f395339e5f01c1e7df0a8b5e7af01b8875280716e21ce93
|
7
|
+
data.tar.gz: f369aaac296c3132e050b68877350798f566dfe883b71522602e6e07252bb43f21c1daada9a821e67508bf7f546d822315a582e892c2d3dd18d7d471275aaecb
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [v0.2.0](https://github.com/metabahn/corerb/releases/tag/2022-06-02)
|
2
|
+
|
3
|
+
*released on 2022-06-02*
|
4
|
+
|
5
|
+
* `fix` [#129](https://github.com/metabahn/corerb/pull/129) Accept all arguments in prepended finalize ([bryanp](https://github.com/bryanp))
|
6
|
+
* `chg` [#118](https://github.com/metabahn/corerb/pull/118) Allow global instance builders to be overridden ([bryanp](https://github.com/bryanp))
|
7
|
+
|
1
8
|
## [v0.1.2](https://github.com/metabahn/corerb/releases/tag/2021-11-02)
|
2
9
|
|
3
10
|
*released on 2021-11-02*
|
data/lib/core/global/version.rb
CHANGED
data/lib/is/global.rb
CHANGED
@@ -11,10 +11,10 @@ module Is
|
|
11
11
|
extend Is::Extension
|
12
12
|
|
13
13
|
extends :definition do
|
14
|
-
# [public]
|
14
|
+
# [public] Build a global instance. This method can safely overrided on a global object and still be memoized.
|
15
15
|
#
|
16
16
|
def global
|
17
|
-
|
17
|
+
new
|
18
18
|
end
|
19
19
|
|
20
20
|
# [public] Reset the global instance.
|
@@ -23,12 +23,18 @@ module Is
|
|
23
23
|
remove_instance_variable(:@__global__) if defined?(@__global__)
|
24
24
|
end
|
25
25
|
|
26
|
-
def finalize
|
26
|
+
def finalize(...)
|
27
27
|
singleton_class.def_delegators(:global, *public_instance_methods(false) - singleton_class.public_instance_methods(false))
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
extends :definition, prepend: true do
|
32
|
+
# [public] Return the current global instance.
|
33
|
+
#
|
34
|
+
def global
|
35
|
+
@__global__ ||= super
|
36
|
+
end
|
37
|
+
|
32
38
|
def method_added(name)
|
33
39
|
if instance_variable_defined?(:@__finalized__)
|
34
40
|
remove_instance_variable(:@__finalized__)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core-global
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: core-extension
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
rubygems_version: 3.
|
57
|
+
rubygems_version: 3.3.13
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: Patterns for responsible global state.
|