ably-rest 1.1.0 → 1.1.2.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -1
  3. data/ably-rest.gemspec +2 -2
  4. data/lib/submodules/ably-ruby/.travis.yml +9 -6
  5. data/lib/submodules/ably-ruby/CHANGELOG.md +18 -1
  6. data/lib/submodules/ably-ruby/README.md +9 -1
  7. data/lib/submodules/ably-ruby/ably.gemspec +4 -4
  8. data/lib/submodules/ably-ruby/lib/ably/logger.rb +7 -1
  9. data/lib/submodules/ably-ruby/lib/ably/modules/state_machine.rb +1 -1
  10. data/lib/submodules/ably-ruby/lib/ably/realtime/client.rb +4 -3
  11. data/lib/submodules/ably-ruby/lib/ably/realtime/connection.rb +26 -15
  12. data/lib/submodules/ably-ruby/lib/ably/realtime/connection/connection_manager.rb +19 -3
  13. data/lib/submodules/ably-ruby/lib/ably/rest/client.rb +4 -2
  14. data/lib/submodules/ably-ruby/lib/ably/version.rb +1 -1
  15. data/lib/submodules/ably-ruby/spec/acceptance/realtime/auth_spec.rb +13 -10
  16. data/lib/submodules/ably-ruby/spec/acceptance/realtime/channel_history_spec.rb +26 -20
  17. data/lib/submodules/ably-ruby/spec/acceptance/realtime/channel_spec.rb +11 -8
  18. data/lib/submodules/ably-ruby/spec/acceptance/realtime/client_spec.rb +8 -4
  19. data/lib/submodules/ably-ruby/spec/acceptance/realtime/connection_failures_spec.rb +71 -5
  20. data/lib/submodules/ably-ruby/spec/acceptance/realtime/connection_spec.rb +125 -14
  21. data/lib/submodules/ably-ruby/spec/acceptance/realtime/message_spec.rb +17 -17
  22. data/lib/submodules/ably-ruby/spec/acceptance/realtime/presence_spec.rb +196 -162
  23. data/lib/submodules/ably-ruby/spec/acceptance/realtime/push_admin_spec.rb +46 -6
  24. data/lib/submodules/ably-ruby/spec/acceptance/rest/channel_spec.rb +37 -0
  25. data/lib/submodules/ably-ruby/spec/acceptance/rest/channels_spec.rb +6 -0
  26. data/lib/submodules/ably-ruby/spec/acceptance/rest/message_spec.rb +8 -27
  27. data/lib/submodules/ably-ruby/spec/acceptance/rest/push_admin_spec.rb +64 -8
  28. data/lib/submodules/ably-ruby/spec/spec_helper.rb +1 -1
  29. data/lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb +9 -5
  30. data/lib/submodules/ably-ruby/spec/unit/modules/enum_spec.rb +1 -1
  31. data/lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb +1 -1
  32. data/lib/submodules/ably-ruby/spec/unit/realtime/connection_spec.rb +1 -1
  33. metadata +11 -11
@@ -2,6 +2,8 @@ RSpec.configure do |config|
2
2
  config.before(:example) do |example|
3
3
  next if example.metadata[:prevent_log_stubbing]
4
4
 
5
+ log_mutex = Mutex.new
6
+
5
7
  @log_output = []
6
8
  %w(fatal error warn info debug).each do |method_name|
7
9
  allow_any_instance_of(Ably::Logger).to receive(method_name.to_sym).and_wrap_original do |method, *args, &block|
@@ -10,11 +12,13 @@ RSpec.configure do |config|
10
12
 
11
13
  prefix = "#{Time.now.strftime('%H:%M:%S.%L')} [\e[33m#{method_name}\e[0m] "
12
14
 
13
- begin
14
- args << block.call unless block.nil?
15
- @log_output << "#{prefix}#{args.compact.join(' ')}"
16
- rescue StandardError => e
17
- @log_output << "#{prefix}Failed to log block - #{e.class}: #{e.message}\n#{e.backtrace.join("\n")}}"
15
+ log_mutex.synchronize do
16
+ begin
17
+ args << block.call unless block.nil?
18
+ @log_output << "#{prefix}#{args.compact.join(' ')}"
19
+ rescue StandardError => e
20
+ @log_output << "#{prefix}Failed to log block - #{e.class}: #{e.message}\n#{e.backtrace.join("\n")}}"
21
+ end
18
22
  end
19
23
 
20
24
  # Call original
@@ -53,7 +53,7 @@ describe Ably::Modules::Enum, :api_private do
53
53
  end
54
54
 
55
55
  it 'allows different type comparison 2' do
56
- skip 'Unless we monkeypath Symbols, the == operator is never invoked'
56
+ skip 'Unless we monkeypatch Symbols, the == operator is never invoked'
57
57
  expect([:value_zero].include?(subject.ValueZero)).to eql(true)
58
58
  end
59
59
 
@@ -13,7 +13,7 @@ describe Ably::Realtime::Client do
13
13
  let(:client_options) { { key: 'appid.keyuid:keysecret', auto_connect: false } }
14
14
 
15
15
  it 'passes on the options to the initializer' do
16
- rest_client = instance_double('Ably::Rest::Client', auth: instance_double('Ably::Auth'), options: client_options)
16
+ rest_client = instance_double('Ably::Rest::Client', auth: instance_double('Ably::Auth'), options: client_options, environment: 'production', use_tls?: true, custom_tls_port: nil)
17
17
  expect(Ably::Rest::Client).to receive(:new).with(hash_including(client_options)).and_return(rest_client)
18
18
  subject
19
19
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'shared/protocol_msgbus_behaviour'
3
3
 
4
4
  describe Ably::Realtime::Connection do
5
- let(:client) { instance_double('Ably::Realtime::Client', logger: double('logger').as_null_object) }
5
+ let(:client) { instance_double('Ably::Realtime::Client', logger: double('logger').as_null_object, recover: nil, endpoint: double('endpoint', host: 'realtime.ably.io')) }
6
6
 
7
7
  subject do
8
8
  Ably::Realtime::Connection.new(client, {}).tap do |connection|
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.0
4
+ version: 1.1.2.rc1
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: 2019-02-06 00:00:00.000000000 Z
11
+ date: 2019-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.6.2
61
+ version: 1.3.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.6.2
68
+ version: 1.3.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: addressable
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '1.3'
89
+ version: 1.3.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'
96
+ version: 1.3.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  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.0.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