proc 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc5ea46072b5407ec2b71822b8406163aeecd2aa6a57d10773e440bb08721ac5
4
- data.tar.gz: 4640295398b9266d57361f62aadf461b9d23e69f9fa0d21d60c5d1cd8b00715f
3
+ metadata.gz: 821daaa038073142fa515aae0833fe8e81f4926a28a4877e554524dc644adf18
4
+ data.tar.gz: ad184bc2e2b55dd5dde33a73e51d4b08c7ab1b26cbb0a627a93c767adb6ba6e5
5
5
  SHA512:
6
- metadata.gz: 45bb39ab2f194fe673f22a09d7d681c8514e639c71829a5673ac437991652212260fa6031c46fbdf92c48397865e1552ca7fdda72064a0ce6011c29dbee5e018
7
- data.tar.gz: 8d1ae22aa4ec5f39cd4c10e2fdf1fa24ad38355e511d5d12cd8935563cb7f6a835a166683922e56bf7db9cc30a5dda7dc649c4c39f3c47b060c5f528f4077331
6
+ metadata.gz: 7a1d0b04708f3858d59308723f7b4aea5e9a5d29501365354353a95846d2d47b539d54040f563c4deb2656a8e0d7b1d64093abdc6d0d4e3cfb3432c9f96c43ca
7
+ data.tar.gz: 9eead252e396cd7376ddf1b3b223c9cf9113ace60d92b3f96b65c3cfcb64797647c0b5328c9dee6706743246c6d01a0935ee162ce31c75c8ba76428cf2d7cbfd
data/README.md CHANGED
@@ -1,80 +1,56 @@
1
- The `proc` gem lets you call codeless web functions through the proc.dev service.
1
+ **This is the official Ruby client for Proc: Serverless web functions with superpowers.**
2
2
 
3
- ## Getting Started
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 `proc` using the `gem` command from the command line:
8
+ ## Install
9
+
10
+ Install with `gem install proc`:
6
11
 
7
12
  ```
8
13
  gem install proc
9
14
  ```
10
15
 
11
- You will also need a proc.dev account. Create a free account in seconds at [proc.dev](https://proc.dev/).
12
-
13
- ## Connecting
16
+ ## Usage
14
17
 
15
- Sign in to your proc.dev account and locate your secret key. Use the secret to create a client connection:
18
+ Connect to proc using an account secret or limited api key:
16
19
 
17
20
  ```ruby
18
- client = Proc.connect("secret-key")
19
- ```
20
-
21
- ## Calling Procs
21
+ require "proc"
22
22
 
23
- You can call available procs through a connected client:
24
-
25
- ```ruby
26
- client.core.string.reverse.call("hello")
27
- => "olleh"
23
+ client = Proc.connect("{your-proc-authorization}")
28
24
  ```
29
25
 
30
- Requests are sent to proc.dev anytime the `call` method is invoked.
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
- string = client.core.string
29
+ client.type.number.add.call(1, {value: 1});
38
30
 
39
- string.reverse.call("hello")
40
- => "olleh"
41
-
42
- string.truncate.call("hello", length: 3)
43
- => "hel"
31
+ => 2
44
32
  ```
45
33
 
46
- Contexts can be configured with default input and arguments using the `with` method:
34
+ Build more complex behaviors by composing procs together:
47
35
 
48
36
  ```ruby
49
- truncate = client.core.string.truncate.with("default", length: 1)
37
+ time = client.time
50
38
 
51
- truncate.call
52
- => "d"
53
- ```
39
+ composition = time.now >> time.format(string: "%A")
54
40
 
55
- Default input and/or arguments can be overidden for a specific call:
41
+ composition.call
56
42
 
57
- ```ruby
58
- truncate.call(length: 3)
59
- => "def"
60
- ```
43
+ => "Tuesday"
44
+ ````
61
45
 
62
- Procs can also be looked up using the hash key syntax:
46
+ Deploy custom endpoints instantly and call them from anywhere:
63
47
 
64
48
  ```ruby
65
- client["core.string.truncate"].call("hello", length: 3)
66
- => "hel"
67
- ```
68
-
69
- ## Compositions
49
+ client.proc.create.call(name: "day_of_week", proc: composition)
70
50
 
71
- Procs can be composed together to build more complex behavior:
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
- composition.call("hello")
77
- => "Oll"
53
+ => "Tuesday"
78
54
  ```
79
55
 
80
- Compositions are sent to proc.dev in a single request.
56
+ Learn more at [proc.dev](https://proc.dev). See you around!
data/lib/proc/client.rb CHANGED
@@ -124,8 +124,8 @@ class Proc
124
124
  end
125
125
 
126
126
  private def refresh_rate_limit
127
- unless defined?(@rate_limit_reset)
128
- self["ping"].call
127
+ unless defined?(@rate_limit)
128
+ self["core.ping"].call
129
129
  end
130
130
  end
131
131
 
@@ -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.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "bigdecimal"
4
+
3
5
  class BigDecimal
4
6
  def to_msgpack(packer)
5
7
  if precision > 16
data/lib/proc/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Proc
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
 
6
6
  # [public]
7
7
  #
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.10.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-01 00:00:00.000000000 Z
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 library.
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://proc.dev/
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: 2.5.0
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.4
90
+ rubygems_version: 3.2.15
91
91
  signing_key:
92
92
  specification_version: 4
93
- summary: Proc client library.
93
+ summary: Proc Ruby client.
94
94
  test_files: []