rpush 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +36 -28
  4. data/lib/rpush/configuration.rb +1 -0
  5. data/lib/rpush/daemon/feeder.rb +16 -12
  6. data/lib/rpush/daemon/interruptible_sleep.rb +26 -5
  7. data/lib/rpush/daemon/store/active_record.rb +4 -0
  8. data/lib/rpush/daemon/store/interface.rb +1 -1
  9. data/lib/rpush/daemon/store/redis.rb +10 -0
  10. data/lib/rpush/embed.rb +1 -0
  11. data/lib/rpush/logger.rb +1 -0
  12. data/lib/rpush/push.rb +1 -2
  13. data/lib/rpush/version.rb +1 -1
  14. data/spec/functional/adm_spec.rb +6 -8
  15. data/spec/functional/apns_spec.rb +9 -9
  16. data/spec/functional/embed_spec.rb +3 -3
  17. data/spec/functional/gcm_spec.rb +6 -8
  18. data/spec/functional/new_app_spec.rb +5 -20
  19. data/spec/functional/retry_spec.rb +8 -12
  20. data/spec/functional/synchronization_spec.rb +1 -1
  21. data/spec/functional/wpns_spec.rb +7 -7
  22. data/spec/functional_spec_helper.rb +4 -5
  23. data/spec/spec_helper.rb +1 -1
  24. data/spec/unit/apns_feedback_spec.rb +4 -4
  25. data/spec/unit/client/active_record/adm/app_spec.rb +12 -12
  26. data/spec/unit/client/active_record/adm/notification_spec.rb +9 -9
  27. data/spec/unit/client/active_record/apns/app_spec.rb +4 -4
  28. data/spec/unit/client/active_record/apns/feedback_spec.rb +2 -2
  29. data/spec/unit/client/active_record/apns/notification_spec.rb +46 -46
  30. data/spec/unit/client/active_record/app_spec.rb +6 -6
  31. data/spec/unit/client/active_record/gcm/notification_spec.rb +7 -7
  32. data/spec/unit/client/active_record/notification_spec.rb +2 -2
  33. data/spec/unit/client/active_record/wpns/notification_spec.rb +2 -8
  34. data/spec/unit/configuration_spec.rb +5 -5
  35. data/spec/unit/daemon/adm/delivery_spec.rb +69 -69
  36. data/spec/unit/daemon/apns/delivery_spec.rb +13 -13
  37. data/spec/unit/daemon/apns/feedback_receiver_spec.rb +24 -26
  38. data/spec/unit/daemon/app_runner_spec.rb +29 -29
  39. data/spec/unit/daemon/batch_spec.rb +30 -30
  40. data/spec/unit/daemon/delivery_error_spec.rb +2 -2
  41. data/spec/unit/daemon/delivery_spec.rb +6 -6
  42. data/spec/unit/daemon/dispatcher/http_spec.rb +5 -5
  43. data/spec/unit/daemon/dispatcher/tcp_spec.rb +4 -4
  44. data/spec/unit/daemon/dispatcher_loop_spec.rb +9 -9
  45. data/spec/unit/daemon/feeder_spec.rb +22 -23
  46. data/spec/unit/daemon/gcm/delivery_spec.rb +56 -56
  47. data/spec/unit/daemon/retryable_error_spec.rb +2 -2
  48. data/spec/unit/daemon/service_config_methods_spec.rb +5 -5
  49. data/spec/unit/daemon/signal_handler_spec.rb +13 -13
  50. data/spec/unit/daemon/store/active_record/reconnectable_spec.rb +13 -13
  51. data/spec/unit/daemon/store/active_record_spec.rb +49 -49
  52. data/spec/unit/daemon/tcp_connection_spec.rb +50 -50
  53. data/spec/unit/daemon/wpns/delivery_spec.rb +36 -36
  54. data/spec/unit/daemon_spec.rb +33 -30
  55. data/spec/unit/deprecatable_spec.rb +3 -3
  56. data/spec/unit/deprecation_spec.rb +2 -2
  57. data/spec/unit/embed_spec.rb +7 -7
  58. data/spec/unit/logger_spec.rb +25 -25
  59. data/spec/unit/notification_shared.rb +7 -7
  60. data/spec/unit/plugin_spec.rb +1 -1
  61. data/spec/unit/push_spec.rb +8 -8
  62. data/spec/unit/reflectable_spec.rb +5 -5
  63. data/spec/unit/reflection_collection_spec.rb +2 -2
  64. data/spec/unit/rpush_spec.rb +1 -1
  65. data/spec/unit_spec_helper.rb +4 -5
  66. metadata +10 -4
@@ -9,19 +9,19 @@ describe Rpush::Reflectable do
9
9
  let(:test_reflectable) { TestReflectable.new }
10
10
 
11
11
  before do
12
- Rpush.reflection_stack[0].stub(:__dispatch)
13
- Rpush.stub(logger: logger)
12
+ allow(Rpush.reflection_stack[0]).to receive(:__dispatch)
13
+ allow(Rpush).to receive_messages(logger: logger)
14
14
  end
15
15
 
16
16
  it 'dispatches the given reflection' do
17
- Rpush.reflection_stack[0].should_receive(:__dispatch).with(:error)
17
+ expect(Rpush.reflection_stack[0]).to receive(:__dispatch).with(:error)
18
18
  test_reflectable.reflect(:error)
19
19
  end
20
20
 
21
21
  it 'logs errors raised by the reflection' do
22
22
  error = StandardError.new
23
- Rpush.reflection_stack[0].stub(:__dispatch).and_raise(error)
24
- Rpush.logger.should_receive(:error).with(error)
23
+ allow(Rpush.reflection_stack[0]).to receive(:__dispatch).and_raise(error)
24
+ expect(Rpush.logger).to receive(:error).with(error)
25
25
  test_reflectable.reflect(:error)
26
26
  end
27
27
  end
@@ -4,7 +4,7 @@
4
4
  it 'yields reflections for configuration' do
5
5
  did_yield = false
6
6
  Rpush.reflect { did_yield = true }
7
- did_yield.should be_true
7
+ expect(did_yield).to eq(true)
8
8
  end
9
9
  end
10
10
 
@@ -15,7 +15,7 @@
15
15
  on.error { did_yield = true }
16
16
  end
17
17
  Rpush.reflection_stack[0].__dispatch(:error)
18
- did_yield.should be_true
18
+ expect(did_yield).to eq(true)
19
19
  end
20
20
 
21
21
  it 'raises an error when trying to dispatch and unknown reflection' do
@@ -2,7 +2,7 @@ require 'unit_spec_helper'
2
2
 
3
3
  describe Rpush do
4
4
  it "lazy initializes the logger" do
5
- Rpush::Logger.should_receive(:new)
5
+ expect(Rpush::Logger).to receive(:new)
6
6
  Rpush.logger
7
7
  end
8
8
  end
@@ -1,9 +1,8 @@
1
1
  require 'spec_helper'
2
2
  require 'rails'
3
3
 
4
- def unit_example?(example)
5
- path = example.metadata[:example_group][:file_path]
6
- path =~ /spec\/unit/
4
+ def unit_example?(metadata)
5
+ metadata[:file_path] =~ /spec\/unit/
7
6
  end
8
7
 
9
8
  def rails4?
@@ -16,7 +15,7 @@ RSpec.configure do |config|
16
15
  redis.keys('rpush:*').each { |key| redis.del(key) }
17
16
  end
18
17
 
19
- if unit_example?(example)
18
+ if unit_example?(self.class.metadata)
20
19
  connection = ActiveRecord::Base.connection
21
20
 
22
21
  if rails4?
@@ -30,7 +29,7 @@ RSpec.configure do |config|
30
29
  end
31
30
 
32
31
  config.after(:each) do
33
- if unit_example?(example)
32
+ if unit_example?(self.class.metadata)
34
33
  connection = ActiveRecord::Base.connection
35
34
 
36
35
  if rails4?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpush
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Leitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-24 00:00:00.000000000 Z
11
+ date: 2015-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -58,14 +58,20 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.18.1
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '2.0'
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
69
  - - ">="
67
70
  - !ruby/object:Gem::Version
68
- version: '0'
71
+ version: 0.18.1
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.0'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: railties
71
77
  requirement: !ruby/object:Gem::Requirement