ably 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: 65f86c14df1cc486e6ebd7ecb98c35a19545f9483ceba68983b8ffcdf11363f8
4
- data.tar.gz: 999b6dbe3a20d4c73b7d18c9b5e4c1e33e3f77bbc52d7b0598764ca71c35a04a
3
+ metadata.gz: f5ca82ab77894c8b5ca135d7ef3c6075b59d485ed288982ef1376cbdc42f54b7
4
+ data.tar.gz: 337b9a88546b8e6024fd448140e94c18f7083298f32e599c810dea8f6c7812b6
5
5
  SHA512:
6
- metadata.gz: 466bc5c7f6547bf298d8e0750a8d1e08abf0afffa214d7ec6ffae62ef39bc9b5cffaa14a6e43a5fc6835bcc359c04384ff66ad3d5b7406c9bfc5baf38b581688
7
- data.tar.gz: 94e257ae6a88f2620ecf218816705fe3af940980ebc0dafbd122fd3c1bfbb9f5960c33f879932e5a142b75f344dff075a48cefd46377c86bca17f5bba660adb8
6
+ metadata.gz: d3b86a46b8a3f45e68d9e83bb8162cd3c095cb66f5476cc3e1e9eaac36f19f35578f37ab96fb639d2fa9813bd2d266363e3bed550ac39b1c0e30606e4523c6ce
7
+ data.tar.gz: 163ad114df99b986581f3bf22b6b4a1672b1611fe9cbafec3766fa38122f2607ae9041d5f748d6836279b59a7076366bb8fccb3ec30aa5f239236e1a8795eb9a
@@ -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'
@@ -33,13 +33,13 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency 'msgpack', '>= 1.3.0'
34
34
  spec.add_runtime_dependency 'addressable', '>= 2.0.0'
35
35
 
36
- spec.add_development_dependency 'rake', '~> 11.3'
36
+ spec.add_development_dependency 'rake', '~> 13.0'
37
37
  spec.add_development_dependency 'redcarpet', '~> 3.3'
38
- spec.add_development_dependency 'rspec', '~> 3.3.0' # version lock, see config.around(:example, :event_machine) in event_machine_helper.rb
38
+ spec.add_development_dependency 'rspec', '~> 3.10.0' # version lock, see config.around(:example, :event_machine) in event_machine_helper.rb
39
39
  spec.add_development_dependency 'rspec-retry', '~> 0.6'
40
40
  spec.add_development_dependency 'yard', '~> 0.9'
41
41
  spec.add_development_dependency 'rspec-instafail', '~> 1.0'
42
- spec.add_development_dependency 'bundler', '>= 1.3.0'
42
+ spec.add_development_dependency 'bundler', '~> 2.2.1'
43
43
 
44
44
  if RUBY_VERSION.match(/^1\./)
45
45
  spec.add_development_dependency 'public_suffix', '~> 1.4.6' # Later versions do not support Ruby 1.9
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ably
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
  - Lewis Marshall
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-15 00:00:00.000000000 Z
12
+ date: 2020-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -57,36 +57,30 @@ dependencies:
57
57
  name: faraday
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: '0.12'
63
- - - "<"
60
+ - - "~>"
64
61
  - !ruby/object:Gem::Version
65
- version: 2.0.0
62
+ version: '1.0'
66
63
  type: :runtime
67
64
  prerelease: false
68
65
  version_requirements: !ruby/object:Gem::Requirement
69
66
  requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: '0.12'
73
- - - "<"
67
+ - - "~>"
74
68
  - !ruby/object:Gem::Version
75
- version: 2.0.0
69
+ version: '1.0'
76
70
  - !ruby/object:Gem::Dependency
77
- name: excon
71
+ name: typhoeus
78
72
  requirement: !ruby/object:Gem::Requirement
79
73
  requirements:
80
74
  - - "~>"
81
75
  - !ruby/object:Gem::Version
82
- version: '0.55'
76
+ version: '1.4'
83
77
  type: :runtime
84
78
  prerelease: false
85
79
  version_requirements: !ruby/object:Gem::Requirement
86
80
  requirements:
87
81
  - - "~>"
88
82
  - !ruby/object:Gem::Version
89
- version: '0.55'
83
+ version: '1.4'
90
84
  - !ruby/object:Gem::Dependency
91
85
  name: json
92
86
  requirement: !ruby/object:Gem::Requirement
@@ -149,14 +143,14 @@ dependencies:
149
143
  requirements:
150
144
  - - "~>"
151
145
  - !ruby/object:Gem::Version
152
- version: '11.3'
146
+ version: '13.0'
153
147
  type: :development
154
148
  prerelease: false
155
149
  version_requirements: !ruby/object:Gem::Requirement
156
150
  requirements:
157
151
  - - "~>"
158
152
  - !ruby/object:Gem::Version
159
- version: '11.3'
153
+ version: '13.0'
160
154
  - !ruby/object:Gem::Dependency
161
155
  name: redcarpet
162
156
  requirement: !ruby/object:Gem::Requirement
@@ -177,14 +171,14 @@ dependencies:
177
171
  requirements:
178
172
  - - "~>"
179
173
  - !ruby/object:Gem::Version
180
- version: 3.3.0
174
+ version: 3.10.0
181
175
  type: :development
182
176
  prerelease: false
183
177
  version_requirements: !ruby/object:Gem::Requirement
184
178
  requirements:
185
179
  - - "~>"
186
180
  - !ruby/object:Gem::Version
187
- version: 3.3.0
181
+ version: 3.10.0
188
182
  - !ruby/object:Gem::Dependency
189
183
  name: rspec-retry
190
184
  requirement: !ruby/object:Gem::Requirement
@@ -231,16 +225,16 @@ dependencies:
231
225
  name: bundler
232
226
  requirement: !ruby/object:Gem::Requirement
233
227
  requirements:
234
- - - ">="
228
+ - - "~>"
235
229
  - !ruby/object:Gem::Version
236
- version: 1.3.0
230
+ version: 2.2.1
237
231
  type: :development
238
232
  prerelease: false
239
233
  version_requirements: !ruby/object:Gem::Requirement
240
234
  requirements:
241
- - - ">="
235
+ - - "~>"
242
236
  - !ruby/object:Gem::Version
243
- version: 1.3.0
237
+ version: 2.2.1
244
238
  - !ruby/object:Gem::Dependency
245
239
  name: webmock
246
240
  requirement: !ruby/object:Gem::Requirement
@@ -529,11 +523,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
529
523
  version: '0'
530
524
  required_rubygems_version: !ruby/object:Gem::Requirement
531
525
  requirements:
532
- - - ">="
526
+ - - ">"
533
527
  - !ruby/object:Gem::Version
534
- version: '0'
528
+ version: 1.3.1
535
529
  requirements: []
536
- rubygems_version: 3.1.2
530
+ rubygems_version: 3.0.3
537
531
  signing_key:
538
532
  specification_version: 4
539
533
  summary: A Ruby client library for ably.io realtime messaging implemented using EventMachine