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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ba04c98482953bcff1570c1b5e7ae7c837cdc2ef6d03a9b8821d5845423e5c0
4
- data.tar.gz: f254547dad6d3627e8a17ad7c3edef898f33c4743e9b669b13448727bc61f267
3
+ metadata.gz: 5554989b8d85210df257092029af21aa849ac4a516f43d61ae59ddef316a4d06
4
+ data.tar.gz: c7b130dfe7f952c7806b4f25e89ac3bf1f0a70266cd23b31d05ff7b5997ee8a4
5
5
  SHA512:
6
- metadata.gz: dae07b7348a022b5a3e57ca99154fff78ad9544ba372ba1346a4c434fa691b11a717aeac00f64f72dde37e5546eb1df189f170c4ded0244a8b08001620c186db
7
- data.tar.gz: 1215a0b83d07b88cf73e63128e1ee967859c27fd8468a21d4fdbc15c69d511c03079073659a52289e7ca4356cecf167e330518ce01e04add2fb4766c3bc3aa15
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*
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Core
4
4
  module Global
5
- VERSION = "0.1.2"
5
+ VERSION = "0.2.0"
6
6
 
7
7
  def self.version
8
8
  VERSION
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] Return the current global instance.
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
- @__global__ ||= new
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.1.2
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: 2021-11-02 00:00:00.000000000 Z
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.2.22
57
+ rubygems_version: 3.3.13
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: Patterns for responsible global state.