async-service 0.5.0 → 0.6.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 +10 -18
- data/lib/async/service/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- 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: c1a6b9d6b8b28e029a194d907ca333a9394f3cf4c0a046193ddc9825d9c415d9
|
4
|
+
data.tar.gz: '082c310afc5f25e5fb053068e6b7e71facbbebc0794ec221a682edd2d069abee'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 608449e59014ab19293db0fbf67a826677d954b48c1fae24096b6984d63e5db326657bf091d696f9786406fac7bc2a78e4bd3ba0fa0bc5c02a8cbc5bc66b8b43
|
7
|
+
data.tar.gz: 1ec0ba61d8afc8aa5f44408e5935717b536b30e994689bd93e10dfe4ba0db6a22b112d905aba4c95a1280b2009ff0f9e73e7eabd173e8ab6920bb05dff29e2ba
|
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,16 +46,8 @@ 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)
|
@@ -72,6 +60,10 @@ module Async
|
|
72
60
|
target.include(@facet)
|
73
61
|
end
|
74
62
|
|
63
|
+
def with(...)
|
64
|
+
return self.class.new(Builder.for(...), self)
|
65
|
+
end
|
66
|
+
|
75
67
|
# An evaluator is lazy read-only view of an environment. It memoizes all method calls.
|
76
68
|
class Evaluator
|
77
69
|
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.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-12 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: async
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.16
|
62
|
+
version: '0.16'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.16
|
69
|
+
version: '0.16'
|
70
70
|
description:
|
71
71
|
email:
|
72
72
|
executables:
|
metadata.gz.sig
CHANGED
Binary file
|