proc 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +26 -50
- data/lib/proc/client.rb +2 -2
- data/lib/proc/composition.rb +2 -2
- data/lib/proc/msgpack/types/decimal.rb +2 -0
- data/lib/proc/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 821daaa038073142fa515aae0833fe8e81f4926a28a4877e554524dc644adf18
|
4
|
+
data.tar.gz: ad184bc2e2b55dd5dde33a73e51d4b08c7ab1b26cbb0a627a93c767adb6ba6e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a1d0b04708f3858d59308723f7b4aea5e9a5d29501365354353a95846d2d47b539d54040f563c4deb2656a8e0d7b1d64093abdc6d0d4e3cfb3432c9f96c43ca
|
7
|
+
data.tar.gz: 9eead252e396cd7376ddf1b3b223c9cf9113ace60d92b3f96b65c3cfcb64797647c0b5328c9dee6706743246c6d01a0935ee162ce31c75c8ba76428cf2d7cbfd
|
data/README.md
CHANGED
@@ -1,80 +1,56 @@
|
|
1
|
-
|
1
|
+
**This is the official Ruby client for Proc: Serverless web functions with superpowers.**
|
2
2
|
|
3
|
-
|
3
|
+
* [Learn more about Proc](https://proc.dev)
|
4
|
+
* [Browse available packages](https://proc.dev/packages)
|
5
|
+
* [Read the docs](https://proc.dev/docs)
|
6
|
+
* [Join chat](https://discord.gg/aRu8qvkCmy)
|
4
7
|
|
5
|
-
Install
|
8
|
+
## Install
|
9
|
+
|
10
|
+
Install with `gem install proc`:
|
6
11
|
|
7
12
|
```
|
8
13
|
gem install proc
|
9
14
|
```
|
10
15
|
|
11
|
-
|
12
|
-
|
13
|
-
## Connecting
|
16
|
+
## Usage
|
14
17
|
|
15
|
-
|
18
|
+
Connect to proc using an account secret or limited api key:
|
16
19
|
|
17
20
|
```ruby
|
18
|
-
|
19
|
-
```
|
20
|
-
|
21
|
-
## Calling Procs
|
21
|
+
require "proc"
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
client.core.string.reverse.call("hello")
|
27
|
-
=> "olleh"
|
23
|
+
client = Proc.connect("{your-proc-authorization}")
|
28
24
|
```
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
## Callable Contexts
|
33
|
-
|
34
|
-
Proc lookups create contexts that can be called later:
|
26
|
+
Now you can call procs just like local code:
|
35
27
|
|
36
28
|
```ruby
|
37
|
-
|
29
|
+
client.type.number.add.call(1, {value: 1});
|
38
30
|
|
39
|
-
|
40
|
-
=> "olleh"
|
41
|
-
|
42
|
-
string.truncate.call("hello", length: 3)
|
43
|
-
=> "hel"
|
31
|
+
=> 2
|
44
32
|
```
|
45
33
|
|
46
|
-
|
34
|
+
Build more complex behaviors by composing procs together:
|
47
35
|
|
48
36
|
```ruby
|
49
|
-
|
37
|
+
time = client.time
|
50
38
|
|
51
|
-
|
52
|
-
=> "d"
|
53
|
-
```
|
39
|
+
composition = time.now >> time.format(string: "%A")
|
54
40
|
|
55
|
-
|
41
|
+
composition.call
|
56
42
|
|
57
|
-
|
58
|
-
|
59
|
-
=> "def"
|
60
|
-
```
|
43
|
+
=> "Tuesday"
|
44
|
+
````
|
61
45
|
|
62
|
-
|
46
|
+
Deploy custom endpoints instantly and call them from anywhere:
|
63
47
|
|
64
48
|
```ruby
|
65
|
-
client
|
66
|
-
=> "hel"
|
67
|
-
```
|
68
|
-
|
69
|
-
## Compositions
|
49
|
+
client.proc.create.call(name: "day_of_week", proc: composition)
|
70
50
|
|
71
|
-
|
72
|
-
|
73
|
-
```ruby
|
74
|
-
composition = client.core.string.reverse >> client.core.string.truncate(length: 3) >> client.core.string.capitalize
|
51
|
+
client.self.day_of_week.call
|
75
52
|
|
76
|
-
|
77
|
-
=> "Oll"
|
53
|
+
=> "Tuesday"
|
78
54
|
```
|
79
55
|
|
80
|
-
|
56
|
+
Learn more at [proc.dev](https://proc.dev). See you around!
|
data/lib/proc/client.rb
CHANGED
data/lib/proc/composition.rb
CHANGED
@@ -29,7 +29,7 @@ class Proc
|
|
29
29
|
arguments: @arguments.merge(arguments)
|
30
30
|
)
|
31
31
|
|
32
|
-
@client.call("exec", Proc.undefined, proc: callable)
|
32
|
+
@client.call("core.exec", Proc.undefined, proc: callable)
|
33
33
|
end
|
34
34
|
|
35
35
|
# [public] Dispatches this composition to proc using the client, calling the given block once for each value.
|
@@ -42,7 +42,7 @@ class Proc
|
|
42
42
|
arguments: @arguments.merge(arguments)
|
43
43
|
)
|
44
44
|
|
45
|
-
@client.call("exec", Proc.undefined, proc: callable, &block)
|
45
|
+
@client.call("core.exec", Proc.undefined, proc: callable, &block)
|
46
46
|
end
|
47
47
|
|
48
48
|
# [public] Creates a new composition based on this one, with a new input and/or arguments.
|
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.11.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-04-
|
11
|
+
date: 2021-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: core-async
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.4'
|
55
|
-
description: Proc client
|
55
|
+
description: Proc Ruby client.
|
56
56
|
email: bryan@metabahn.com
|
57
57
|
executables: []
|
58
58
|
extensions: []
|
@@ -68,7 +68,7 @@ files:
|
|
68
68
|
- lib/proc/enumerator.rb
|
69
69
|
- lib/proc/msgpack/types/decimal.rb
|
70
70
|
- lib/proc/version.rb
|
71
|
-
homepage: https://
|
71
|
+
homepage: https://github.com/metabahn/proc-rb/
|
72
72
|
licenses:
|
73
73
|
- MPL-2.0
|
74
74
|
metadata: {}
|
@@ -80,15 +80,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 3.0.0
|
84
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
rubygems_version: 3.2.
|
90
|
+
rubygems_version: 3.2.15
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
|
-
summary: Proc client
|
93
|
+
summary: Proc Ruby client.
|
94
94
|
test_files: []
|