async-service 0.5.1 → 0.6.1
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 +14 -18
- 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: 2c5d89c7f841e6cbe16bad8337324981ef85f1da92d2a8b8acada2c12a51c91c
|
4
|
+
data.tar.gz: 0fe963d6d034ce7b2c0644405fd2044cbd6645c61514d3be3698fdf0a2a52f7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86087e42a857958582c02812a59391378f6ba8a62beb49641a67d90db744c6007299926b5b0d41db0a13fc1cbf8fe498593a5e1c45e65f57fcd6e03ecdd4f4b6
|
7
|
+
data.tar.gz: 17b9d71be9c88bcbbb52dfb0f15a75bf914062c757cfd4b4fbef058d83c99ea664495c58de3d7f3c6758438bb9d52fcf027124bbe8d6ad3e187c121e790e8827
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -7,8 +7,10 @@ module Async
|
|
7
7
|
module Service
|
8
8
|
class Environment
|
9
9
|
class Builder < BasicObject
|
10
|
-
def self.
|
11
|
-
|
10
|
+
def self.for(facet = ::Module.new, **values, &block)
|
11
|
+
builder = self.new(facet)
|
12
|
+
|
13
|
+
values.each do |key, value|
|
12
14
|
if value.is_a?(::Proc)
|
13
15
|
facet.define_method(key, &value)
|
14
16
|
else
|
@@ -16,12 +18,6 @@ module Async
|
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
19
|
-
return facet
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.for(facet = ::Module.new, &block)
|
23
|
-
builder = self.new(facet)
|
24
|
-
|
25
21
|
builder.instance_exec(&block) if block_given?
|
26
22
|
|
27
23
|
return facet
|
@@ -50,19 +46,15 @@ module Async
|
|
50
46
|
end
|
51
47
|
end
|
52
48
|
|
53
|
-
def self.build(
|
54
|
-
|
55
|
-
environment = Environment.new(Builder.wrap(values))
|
56
|
-
end
|
57
|
-
|
58
|
-
if block_given?
|
59
|
-
environment = Environment.new(Builder.for(&block), environment)
|
60
|
-
end
|
61
|
-
|
62
|
-
return environment
|
49
|
+
def self.build(...)
|
50
|
+
Environment.new(Builder.for(...))
|
63
51
|
end
|
64
52
|
|
65
53
|
def initialize(facet = ::Module.new, parent = nil)
|
54
|
+
unless facet.class == ::Module
|
55
|
+
raise ArgumentError, "Facet must be a module!"
|
56
|
+
end
|
57
|
+
|
66
58
|
@facet = facet
|
67
59
|
@parent = parent
|
68
60
|
end
|
@@ -72,6 +64,10 @@ module Async
|
|
72
64
|
target.include(@facet)
|
73
65
|
end
|
74
66
|
|
67
|
+
def with(...)
|
68
|
+
return self.class.new(Builder.for(...), self)
|
69
|
+
end
|
70
|
+
|
75
71
|
# An evaluator is lazy read-only view of an environment. It memoizes all method calls.
|
76
72
|
class Evaluator
|
77
73
|
def self.wrap(environment)
|
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.6.1
|
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
|