async-service 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/service/environment.rb +17 -5
- data/lib/async/service/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8715972e602d996a04c5d8ed36f765eab4e4eda85c5f978cd9d10b66dc48fee3
|
4
|
+
data.tar.gz: abd69a1148bcb121887aef3943a1a7fea9916d88c8d683ba25f1572a8f869bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e9618479dab469fdc62db4058a25bbe2eccbc2b1c33a6b44af7b277eaa030220cd25dd5b8d720e51b2d964ecd525d123d4d423965920d2c79b4119714a866db
|
7
|
+
data.tar.gz: c018787aef323da8805c471cc59a5a4fcbe21c83f789fbbbdd24cc37ff6c9b619f58dba04cf023390469632e72f9ccadb00498ef82f9198e50d691612e523b10
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -51,6 +51,10 @@ module Async
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def initialize(facet = ::Module.new, parent = nil)
|
54
|
+
unless facet.class == ::Module
|
55
|
+
raise ArgumentError, "Facet must be a module!"
|
56
|
+
end
|
57
|
+
|
54
58
|
@facet = facet
|
55
59
|
@parent = parent
|
56
60
|
end
|
@@ -74,16 +78,24 @@ module Async
|
|
74
78
|
|
75
79
|
evaluator.include(facet)
|
76
80
|
|
81
|
+
keys = []
|
82
|
+
|
77
83
|
# Memoize all instance methods:
|
78
84
|
facet.instance_methods.each do |name|
|
79
|
-
|
80
|
-
|
85
|
+
instance_method = facet.instance_method(name)
|
86
|
+
|
87
|
+
# Only memoize methods with no arguments:
|
88
|
+
if instance_method.arity == 0
|
89
|
+
keys << name
|
90
|
+
|
91
|
+
evaluator.define_method(name) do
|
92
|
+
@cache[name] ||= super()
|
93
|
+
end
|
81
94
|
end
|
82
95
|
end
|
83
96
|
|
84
|
-
|
85
|
-
|
86
|
-
end
|
97
|
+
# This lists all zero-argument methods:
|
98
|
+
evaluator.define_method(:keys) {keys}
|
87
99
|
|
88
100
|
return evaluator.new
|
89
101
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2024-03-
|
40
|
+
date: 2024-03-17 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: async
|
metadata.gz.sig
CHANGED
Binary file
|