async-rest 0.7.3 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/async-rest.gemspec +1 -2
- data/examples/slack/clean.rb +5 -5
- data/lib/async/rest/version.rb +1 -1
- data/lib/async/rest/wrapper/url_encoded.rb +2 -2
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3ccf5222149954ba21b9e57ec80f14752fdaa126e7c53ba152666557812dcbc
|
4
|
+
data.tar.gz: a26d1cf50daa97e4ebc05b606b83273879dfd92e39d50190f3868153192e87ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd34a5f9ca74d4992f272b788322785af7bb2dd7ebc33bf20cd80a1d1b39179325a121b5e658cea74cab8e90f03cc7e428d5f34e5e9be65cf7c7b2fe7300306b
|
7
|
+
data.tar.gz: 4ae3d9d692e6e8136aacd801a0356e8181322ac66a6fe7110089eca61578c19ee74cae2ae60544ff0f3223795fc2307d0937839afe1487cd8b6720df7a9a4d5c
|
data/async-rest.gemspec
CHANGED
@@ -16,8 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "async-http", "~> 0.
|
20
|
-
spec.add_dependency "http-protocol", "~> 0.14"
|
19
|
+
spec.add_dependency "async-http", "~> 0.39"
|
21
20
|
|
22
21
|
spec.add_development_dependency "async-rspec", "~> 1.1"
|
23
22
|
|
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.count} messages on page #{page}..."
|
29
|
+
puts "Found #{matches.count} messages on page #{page} out of #{messages[:total]}..."
|
30
30
|
|
31
31
|
break if matches.empty?
|
32
32
|
|
@@ -35,17 +35,17 @@ Async::REST::Resource.for(URL) do |resource|
|
|
35
35
|
channel_id = message[:channel][:id]
|
36
36
|
channel_name = message[:channel][:name]
|
37
37
|
timestamp = message[:ts]
|
38
|
-
|
38
|
+
|
39
39
|
pp [timestamp, channel_name, text]
|
40
|
-
|
40
|
+
|
41
41
|
message_delete = Async::REST::Representation.new(
|
42
42
|
delete.with(parameters: {channel: channel_id, ts: timestamp})
|
43
43
|
)
|
44
|
-
|
44
|
+
|
45
45
|
response = message_delete.post
|
46
46
|
if rate_limited?(response.read)
|
47
47
|
puts "Rate limiting..."
|
48
|
-
Async::Task.current.sleep
|
48
|
+
Async::Task.current.sleep 10
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
data/lib/async/rest/version.rb
CHANGED
@@ -46,7 +46,7 @@ module Async
|
|
46
46
|
headers['content-type'] = @content_type
|
47
47
|
|
48
48
|
HTTP::Body::Buffered.new([
|
49
|
-
::HTTP::
|
49
|
+
::Protocol::HTTP::URL.encode(payload)
|
50
50
|
])
|
51
51
|
end
|
52
52
|
end
|
@@ -67,7 +67,7 @@ module Async
|
|
67
67
|
|
68
68
|
class Parser < HTTP::Body::Wrapper
|
69
69
|
def join
|
70
|
-
::HTTP::
|
70
|
+
::Protocol::HTTP::URL.decode(super, symbolize_keys: true)
|
71
71
|
end
|
72
72
|
end
|
73
73
|
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.
|
4
|
+
version: 0.8.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-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.39'
|
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.
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: http-protocol
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.14'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0.14'
|
26
|
+
version: '0.39'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: async-rspec
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
134
|
- !ruby/object:Gem::Version
|
149
135
|
version: '0'
|
150
136
|
requirements: []
|
151
|
-
rubygems_version: 3.0.
|
137
|
+
rubygems_version: 3.0.3
|
152
138
|
signing_key:
|
153
139
|
specification_version: 4
|
154
140
|
summary: A library for RESTful clients (and hopefully servers).
|