async-rest 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/slack/clean.rb +1 -1
- data/lib/async/rest/resource.rb +8 -5
- data/lib/async/rest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a406ea0610d8c9f964d11b6c53881ef9e34b02a49dce5db69e35786f005c17e
|
4
|
+
data.tar.gz: 9f993dccfca870612bb7a30ea84a8ad566606cf6cbbd951891cd4861820c12b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 148b577baeb3606ad99ee9fe2211f91150e2d047e17b84f8c61f4ffc53642765375ef0cfc3048e173ca36f74542f6f511160e7ec9ac64abe62b8396c32faf28f
|
7
|
+
data.tar.gz: 7cdf063ca9b4b228452e1502a552a74d7aabaff4ac625394498c75bc1bdfc3df7fef7414db19c050ff540000540432d4cf819d7a56c195ea5d0176920e5221dc
|
data/examples/slack/clean.rb
CHANGED
@@ -26,7 +26,7 @@ Async::REST::Resource.for(URL) do |resource|
|
|
26
26
|
messages = representation.value[:messages]
|
27
27
|
matches = messages[:matches]
|
28
28
|
|
29
|
-
puts "Found #{matches.
|
29
|
+
puts "Found #{matches.size} messages on page #{page} out of #{messages[:total]}..."
|
30
30
|
|
31
31
|
break if matches.empty?
|
32
32
|
|
data/lib/async/rest/resource.rb
CHANGED
@@ -39,16 +39,19 @@ module Async
|
|
39
39
|
@headers = headers
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.connect(
|
43
|
-
endpoint = HTTP::Endpoint.parse(url)
|
44
|
-
|
42
|
+
def self.connect(endpoint)
|
45
43
|
reference = ::Protocol::HTTP::Reference.parse(endpoint.path)
|
46
44
|
|
47
45
|
return ::Protocol::HTTP::AcceptEncoding.new(HTTP::Client.new(endpoint)), reference
|
48
46
|
end
|
49
47
|
|
50
|
-
def self.for(
|
51
|
-
|
48
|
+
def self.for(endpoint, *args)
|
49
|
+
# TODO This behaviour is deprecated and will probably be removed.
|
50
|
+
if endpoint.is_a? String
|
51
|
+
endpoint = HTTP::Endpoint.parse(endpoint)
|
52
|
+
end
|
53
|
+
|
54
|
+
client, reference = connect(endpoint)
|
52
55
|
|
53
56
|
resource = self.new(client, reference, *args)
|
54
57
|
|
data/lib/async/rest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|