rpush 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +36 -28
- data/lib/rpush/configuration.rb +1 -0
- data/lib/rpush/daemon/feeder.rb +16 -12
- data/lib/rpush/daemon/interruptible_sleep.rb +26 -5
- data/lib/rpush/daemon/store/active_record.rb +4 -0
- data/lib/rpush/daemon/store/interface.rb +1 -1
- data/lib/rpush/daemon/store/redis.rb +10 -0
- data/lib/rpush/embed.rb +1 -0
- data/lib/rpush/logger.rb +1 -0
- data/lib/rpush/push.rb +1 -2
- data/lib/rpush/version.rb +1 -1
- data/spec/functional/adm_spec.rb +6 -8
- data/spec/functional/apns_spec.rb +9 -9
- data/spec/functional/embed_spec.rb +3 -3
- data/spec/functional/gcm_spec.rb +6 -8
- data/spec/functional/new_app_spec.rb +5 -20
- data/spec/functional/retry_spec.rb +8 -12
- data/spec/functional/synchronization_spec.rb +1 -1
- data/spec/functional/wpns_spec.rb +7 -7
- data/spec/functional_spec_helper.rb +4 -5
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/apns_feedback_spec.rb +4 -4
- data/spec/unit/client/active_record/adm/app_spec.rb +12 -12
- data/spec/unit/client/active_record/adm/notification_spec.rb +9 -9
- data/spec/unit/client/active_record/apns/app_spec.rb +4 -4
- data/spec/unit/client/active_record/apns/feedback_spec.rb +2 -2
- data/spec/unit/client/active_record/apns/notification_spec.rb +46 -46
- data/spec/unit/client/active_record/app_spec.rb +6 -6
- data/spec/unit/client/active_record/gcm/notification_spec.rb +7 -7
- data/spec/unit/client/active_record/notification_spec.rb +2 -2
- data/spec/unit/client/active_record/wpns/notification_spec.rb +2 -8
- data/spec/unit/configuration_spec.rb +5 -5
- data/spec/unit/daemon/adm/delivery_spec.rb +69 -69
- data/spec/unit/daemon/apns/delivery_spec.rb +13 -13
- data/spec/unit/daemon/apns/feedback_receiver_spec.rb +24 -26
- data/spec/unit/daemon/app_runner_spec.rb +29 -29
- data/spec/unit/daemon/batch_spec.rb +30 -30
- data/spec/unit/daemon/delivery_error_spec.rb +2 -2
- data/spec/unit/daemon/delivery_spec.rb +6 -6
- data/spec/unit/daemon/dispatcher/http_spec.rb +5 -5
- data/spec/unit/daemon/dispatcher/tcp_spec.rb +4 -4
- data/spec/unit/daemon/dispatcher_loop_spec.rb +9 -9
- data/spec/unit/daemon/feeder_spec.rb +22 -23
- data/spec/unit/daemon/gcm/delivery_spec.rb +56 -56
- data/spec/unit/daemon/retryable_error_spec.rb +2 -2
- data/spec/unit/daemon/service_config_methods_spec.rb +5 -5
- data/spec/unit/daemon/signal_handler_spec.rb +13 -13
- data/spec/unit/daemon/store/active_record/reconnectable_spec.rb +13 -13
- data/spec/unit/daemon/store/active_record_spec.rb +49 -49
- data/spec/unit/daemon/tcp_connection_spec.rb +50 -50
- data/spec/unit/daemon/wpns/delivery_spec.rb +36 -36
- data/spec/unit/daemon_spec.rb +33 -30
- data/spec/unit/deprecatable_spec.rb +3 -3
- data/spec/unit/deprecation_spec.rb +2 -2
- data/spec/unit/embed_spec.rb +7 -7
- data/spec/unit/logger_spec.rb +25 -25
- data/spec/unit/notification_shared.rb +7 -7
- data/spec/unit/plugin_spec.rb +1 -1
- data/spec/unit/push_spec.rb +8 -8
- data/spec/unit/reflectable_spec.rb +5 -5
- data/spec/unit/reflection_collection_spec.rb +2 -2
- data/spec/unit/rpush_spec.rb +1 -1
- data/spec/unit_spec_helper.rb +4 -5
- 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].
|
13
|
-
Rpush.
|
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].
|
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].
|
24
|
-
Rpush.logger.
|
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.
|
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.
|
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
|
data/spec/unit/rpush_spec.rb
CHANGED
data/spec/unit_spec_helper.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'rails'
|
3
3
|
|
4
|
-
def unit_example?(
|
5
|
-
|
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?(
|
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?(
|
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.
|
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-
|
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:
|
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:
|
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
|