ably-rest 1.1.3 → 1.1.4.rc

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: 2ebbf06f58854a46fb19f1d908463d6f8fbd39807a461cc478443ab03a3abdbc
4
- data.tar.gz: '035845c681c3672a56b8fa50bbe1bc2508d791c4075914d470d9b521d1074b3a'
3
+ metadata.gz: 12d0c3187eec6e03160420f9266a02e4b57017c45cc9792cb701644bd594b8f6
4
+ data.tar.gz: c5c0a1da2d5f750452b3693ea616c58ddb9bf925afc7a6766859668293241adb
5
5
  SHA512:
6
- metadata.gz: 7892f515bdc0d7b82f5ee0e4ee64e96cb2a6f69d66bc67f22c7f0de380c516c624585a3e0e22481783438211e785e71d4cc04fb62c971cd976212ba2058e63ab
7
- data.tar.gz: 985fbbbe7f35c6e03a6f3f900d6d283ae2b4f3b5d041c0abced17463913603dd8fe38aa1ae0e8576d7d9caf1f2508e081ef7e8808ef8a369eff6c4fcf3b7590f
6
+ metadata.gz: f321aa69c45f938136ab02c5fd466cc33b661a6481b5244edf8d4eca1090879c9bb1b568d181794a88df623bb971ac3fd5da879b9df012a110a247ae86807eed
7
+ data.tar.gz: b4df91228d73641db9ce8b9ed3e98420c0ada82cd657d0122dacc471307104932c13be50938d0f8b14b5a68b51e12ae475f962235d5e05097aad811388cb5c3d
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_runtime_dependency 'faraday', '~> 0.12'
35
- spec.add_runtime_dependency 'excon', '~> 0.55'
34
+ spec.add_runtime_dependency 'faraday', '~> 1.0'
35
+ spec.add_runtime_dependency 'typhoeus', '~> 1.4'
36
36
 
37
37
  if RUBY_VERSION.match(/^1/)
38
38
  spec.add_runtime_dependency 'json', '< 2.0'
@@ -42,11 +42,11 @@ Gem::Specification.new do |spec|
42
42
  spec.add_runtime_dependency 'msgpack', '>= 0.6.2'
43
43
  spec.add_runtime_dependency 'addressable', '>= 2.0.0'
44
44
 
45
- spec.add_development_dependency 'bundler', '>= 1.3.0'
46
- spec.add_development_dependency 'rake', '~> 11.3'
45
+ spec.add_development_dependency 'rake', '~> 13.0'
46
+ spec.add_development_dependency 'bundler', '~> 2.2.1'
47
47
  spec.add_development_dependency 'redcarpet', '~> 3.3'
48
- spec.add_development_dependency 'rspec', '~> 3.2.0'
49
- spec.add_development_dependency 'rspec-retry', '~> 0.4'
48
+ spec.add_development_dependency 'rspec', '~> 3.10.0'
49
+ spec.add_development_dependency 'rspec-retry', '~> 0.6'
50
50
  spec.add_development_dependency 'yard', '~> 0.9'
51
51
 
52
52
  if RUBY_VERSION.match(/^1/)
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.add_runtime_dependency 'eventmachine', '~> 1.2.6'
22
22
  spec.add_runtime_dependency 'em-http-request', '~> 1.1'
23
23
  spec.add_runtime_dependency 'statesman', '~> 1.0.0'
24
- spec.add_runtime_dependency 'faraday', '>= 0.12', '< 2.0.0'
25
- spec.add_runtime_dependency 'excon', '~> 0.55'
24
+ spec.add_runtime_dependency 'faraday', '~> 1.0'
25
+ spec.add_runtime_dependency 'typhoeus', '~> 1.4'
26
26
 
27
27
  if RUBY_VERSION.match(/^1\./)
28
28
  spec.add_runtime_dependency 'json', '< 2.0'
@@ -3,6 +3,9 @@ require 'json'
3
3
  require 'logger'
4
4
  require 'uri'
5
5
 
6
+ require 'typhoeus'
7
+ require 'typhoeus/adapters/faraday'
8
+
6
9
  require 'ably/rest/middleware/exceptions'
7
10
 
8
11
  module Ably
@@ -202,6 +205,8 @@ module Ably
202
205
  @http_defaults = HTTP_DEFAULTS.dup
203
206
  options.each do |key, val|
204
207
  if http_key = key[/^http_(.+)/, 1]
208
+ # Typhoeus converts decimal durations to milliseconds, so 0.0001 timeout is treated as 0 (no timeout)
209
+ val = 0.001 if val.kind_of?(Numeric) && (val > 0) && (val < 0.001)
205
210
  @http_defaults[http_key.to_sym] = val if val && @http_defaults.has_key?(http_key.to_sym)
206
211
  end
207
212
  end
@@ -666,7 +671,7 @@ module Ably
666
671
  }
667
672
  end
668
673
 
669
- # Return a Faraday middleware stack to initiate the Faraday::Connection with
674
+ # Return a Faraday middleware stack to initiate the Faraday::RackBuilder with
670
675
  #
671
676
  # @see http://mislav.uniqpath.com/2011/07/faraday-advanced-http/
672
677
  def middleware
@@ -678,8 +683,8 @@ module Ably
678
683
 
679
684
  setup_incoming_middleware builder, logger, fail_if_unsupported_mime_type: true
680
685
 
681
- # Set Faraday's HTTP adapter
682
- builder.adapter :excon
686
+ # Set Faraday's HTTP adapter with support for HTTP/2
687
+ builder.adapter :typhoeus, http_version: :httpv2_0
683
688
  end
684
689
  end
685
690
 
@@ -7,7 +7,10 @@ module Ably
7
7
  class FailIfUnsupportedMimeType < Faraday::Response::Middleware
8
8
  def on_complete(env)
9
9
  unless env.response_headers['Ably-Middleware-Parsed'] == true
10
- unless (500..599).include?(env.status)
10
+ # Ignore empty body with success status code for no body response
11
+ return if env.body.to_s.empty? && env.status == 204
12
+
13
+ unless (500..599).include?(env.status)
11
14
  raise Ably::Exceptions::InvalidResponseBody,
12
15
  "Content Type #{env.response_headers['Content-Type']} is not supported by this client library"
13
16
  end
@@ -1,5 +1,5 @@
1
1
  module Ably
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.4.rc'
3
3
  PROTOCOL_VERSION = '1.1'
4
4
 
5
5
  # Allow a variant to be configured for all instances of this client library
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ably-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4.rc
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew O'Riordan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.12'
19
+ version: '1.0'
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.12'
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: excon
28
+ name: typhoeus
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.55'
33
+ version: '1.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.55'
40
+ version: '1.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: json
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -81,33 +81,33 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.0.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: bundler
84
+ name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.3.0
89
+ version: '13.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.3.0
96
+ version: '13.0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rake
98
+ name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '11.3'
103
+ version: 2.2.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '11.3'
110
+ version: 2.2.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: redcarpet
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 3.2.0
131
+ version: 3.10.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 3.2.0
138
+ version: 3.10.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec-retry
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.4'
145
+ version: '0.6'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.4'
152
+ version: '0.6'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: yard
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -458,11 +458,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
458
458
  version: '0'
459
459
  required_rubygems_version: !ruby/object:Gem::Requirement
460
460
  requirements:
461
- - - ">="
461
+ - - ">"
462
462
  - !ruby/object:Gem::Version
463
- version: '0'
463
+ version: 1.3.1
464
464
  requirements: []
465
- rubygems_version: 3.1.2
465
+ rubygems_version: 3.0.3
466
466
  signing_key:
467
467
  specification_version: 4
468
468
  summary: A Ruby REST only client library for ably.io realtime messaging