proc 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
- data/lib/proc.rb +1 -1
- data/lib/proc/callable.rb +6 -2
- data/lib/proc/composition.rb +1 -13
- data/lib/proc/http/client.rb +5 -13
- data/lib/proc/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3436b4fd5fc66c40110f6dbf9cae15ab41d3e056126efd0aeb2ea1f3d9a0dd17
|
4
|
+
data.tar.gz: 1e4d324315a902f1f53ad611f8379cc6a3ec86f7c897c0dd27cf8901736c85ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac68f3119ab651efe8705ebe7cc68ad33e7cf9b49c58248c390f5667e31f7521b2b8494f169e213aae4a1a4371df45c6d485b04af743ddb872c993ed04c0dd2b
|
7
|
+
data.tar.gz: cc114dca8b977b3b365127120ad0f1ae37b53e0e75e5f2a025d9bc0741ebdc5f9fb667be6fd4df2793eab0fd9c02ea5b902146f995624d832f91642d2a4064cc
|
data/lib/proc.rb
CHANGED
data/lib/proc/callable.rb
CHANGED
@@ -43,7 +43,7 @@ class Proc
|
|
43
43
|
composed
|
44
44
|
end
|
45
45
|
|
46
|
-
def serialize
|
46
|
+
def serialize(unwrapped: false)
|
47
47
|
serialized = ["()", @proc]
|
48
48
|
|
49
49
|
unless Proc.undefined?(@input)
|
@@ -52,7 +52,11 @@ class Proc
|
|
52
52
|
|
53
53
|
serialized.concat(serialized_arguments)
|
54
54
|
|
55
|
-
|
55
|
+
if unwrapped
|
56
|
+
serialized
|
57
|
+
else
|
58
|
+
["{}", serialized]
|
59
|
+
end
|
56
60
|
end
|
57
61
|
|
58
62
|
def serialized_input
|
data/lib/proc/composition.rb
CHANGED
@@ -57,19 +57,7 @@ class Proc
|
|
57
57
|
serialized << [">>", serialized_input]
|
58
58
|
end
|
59
59
|
|
60
|
-
serialized + serialized_arguments +
|
61
|
-
end
|
62
|
-
|
63
|
-
def serialized_calls
|
64
|
-
@callables.map { |callable|
|
65
|
-
serialized = ["()", callable.proc]
|
66
|
-
|
67
|
-
unless Proc.undefined?(callable.input)
|
68
|
-
serialized << [">>", callable.serialized_input]
|
69
|
-
end
|
70
|
-
|
71
|
-
serialized.concat(callable.serialized_arguments)
|
72
|
-
}
|
60
|
+
serialized + serialized_arguments + @callables.map { |callable| callable.serialize(unwrapped: true) }
|
73
61
|
end
|
74
62
|
|
75
63
|
def serialized_input
|
data/lib/proc/http/client.rb
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
require "async"
|
4
4
|
require "async/http/internet"
|
5
5
|
|
6
|
-
require "protocol/http/body/streamable"
|
7
|
-
|
8
6
|
require "core/async"
|
9
7
|
|
10
8
|
require_relative "request"
|
@@ -15,30 +13,24 @@ class Proc
|
|
15
13
|
class Client
|
16
14
|
include Is::Async
|
17
15
|
|
18
|
-
def initialize
|
19
|
-
@internet = Async::HTTP::Internet.new
|
20
|
-
end
|
21
|
-
|
22
16
|
def call(method, uri, params: {}, headers: {}, body: nil)
|
17
|
+
internet = Async::HTTP::Internet.new
|
23
18
|
request = Request.new(method: method, uri: uri, params: params, headers: headers, body: body)
|
24
19
|
|
25
20
|
await {
|
26
21
|
begin
|
27
|
-
response = make_request(request)
|
22
|
+
response = make_request(internet, request)
|
28
23
|
|
29
24
|
yield response
|
30
25
|
ensure
|
31
26
|
response&.close
|
27
|
+
internet&.close
|
32
28
|
end
|
33
29
|
}
|
34
30
|
end
|
35
31
|
|
36
|
-
def
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
private def make_request(request)
|
41
|
-
async_response = @internet.call(*request.callable)
|
32
|
+
private def make_request(internet, request)
|
33
|
+
async_response = internet.call(*request.callable)
|
42
34
|
wrap_async_response_for_request(async_response, request)
|
43
35
|
end
|
44
36
|
|
data/lib/proc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.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-02-
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.54.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.54.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: core-async
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: oj
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.11'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.11'
|
55
55
|
description: Proc client library.
|
56
56
|
email: bryan@metabahn.com
|
57
57
|
executables: []
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
|
-
rubygems_version: 3.
|
91
|
+
rubygems_version: 3.2.4
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Proc client library.
|