async-rest 0.9.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b63889027214f114310b9fe8f9a2996f11c56e0f42a6b796312cec368de8c460
4
- data.tar.gz: a054ae31432301990edc8399321dc1c678567770917afacb16f3d7ddb2ed12ec
3
+ metadata.gz: 1a406ea0610d8c9f964d11b6c53881ef9e34b02a49dce5db69e35786f005c17e
4
+ data.tar.gz: 9f993dccfca870612bb7a30ea84a8ad566606cf6cbbd951891cd4861820c12b9
5
5
  SHA512:
6
- metadata.gz: 8952cfb675125f2349d71e3138211f63109ba793ff0a5062a7ecb11cf03a1379a04a6c8362ffb0605019a88a350b8bf5a0ebeaf9f281ad495d5d3567c1350d90
7
- data.tar.gz: 86b0ba32227b6154ad13a2d43fff29d37608b670adc61c0fcc5e442077e20c21c8326959a58cd22fe8c566fcce02bf82ddceaf25e762fbdc2fca0e71f007daae
6
+ metadata.gz: 148b577baeb3606ad99ee9fe2211f91150e2d047e17b84f8c61f4ffc53642765375ef0cfc3048e173ca36f74542f6f511160e7ec9ac64abe62b8396c32faf28f
7
+ data.tar.gz: 7cdf063ca9b4b228452e1502a552a74d7aabaff4ac625394498c75bc1bdfc3df7fef7414db19c050ff540000540432d4cf819d7a56c195ea5d0176920e5221dc
@@ -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.count} messages on page #{page} out of #{messages[:total]}..."
29
+ puts "Found #{matches.size} messages on page #{page} out of #{messages[:total]}..."
30
30
 
31
31
  break if matches.empty?
32
32
 
@@ -39,16 +39,19 @@ module Async
39
39
  @headers = headers
40
40
  end
41
41
 
42
- def self.connect(url)
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(url, *args)
51
- client, reference = connect(url)
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
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module REST
23
- VERSION = "0.9.0"
23
+ VERSION = "0.10.0"
24
24
  end
25
25
  end
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.9.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-06-21 00:00:00.000000000 Z
11
+ date: 2019-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http