rpush 2.4.0-java → 2.6.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -1
  3. data/README.md +18 -8
  4. data/lib/generators/rpush_migration_generator.rb +1 -0
  5. data/lib/generators/templates/rpush.rb +8 -2
  6. data/lib/generators/templates/rpush_2_0_0_updates.rb +1 -1
  7. data/lib/generators/templates/rpush_2_6_0_updates.rb +10 -0
  8. data/lib/rpush/cli.rb +63 -27
  9. data/lib/rpush/client/active_model.rb +3 -0
  10. data/lib/rpush/client/active_model/apns/notification.rb +1 -1
  11. data/lib/rpush/client/active_model/gcm/notification.rb +1 -0
  12. data/lib/rpush/client/active_model/wns/app.rb +23 -0
  13. data/lib/rpush/client/active_model/wns/notification.rb +28 -0
  14. data/lib/rpush/client/active_model/wpns/notification.rb +11 -6
  15. data/lib/rpush/client/active_record.rb +3 -0
  16. data/lib/rpush/client/active_record/notification.rb +1 -1
  17. data/lib/rpush/client/active_record/wns/app.rb +11 -0
  18. data/lib/rpush/client/active_record/wns/notification.rb +11 -0
  19. data/lib/rpush/client/mongoid.rb +3 -0
  20. data/lib/rpush/client/mongoid/apns/feedback.rb +3 -0
  21. data/lib/rpush/client/mongoid/notification.rb +7 -0
  22. data/lib/rpush/client/mongoid/wns/app.rb +14 -0
  23. data/lib/rpush/client/mongoid/wns/notification.rb +11 -0
  24. data/lib/rpush/client/redis.rb +3 -0
  25. data/lib/rpush/client/redis/notification.rb +1 -0
  26. data/lib/rpush/client/redis/wns/app.rb +14 -0
  27. data/lib/rpush/client/redis/wns/notification.rb +11 -0
  28. data/lib/rpush/configuration.rb +3 -7
  29. data/lib/rpush/daemon.rb +9 -0
  30. data/lib/rpush/daemon/apns/feedback_receiver.rb +5 -0
  31. data/lib/rpush/daemon/app_runner.rb +4 -5
  32. data/lib/rpush/daemon/dispatcher/apns_tcp.rb +47 -12
  33. data/lib/rpush/daemon/dispatcher_loop.rb +5 -0
  34. data/lib/rpush/daemon/feeder.rb +11 -0
  35. data/lib/rpush/daemon/gcm/delivery.rb +2 -2
  36. data/lib/rpush/daemon/interruptible_sleep.rb +8 -3
  37. data/lib/rpush/daemon/loggable.rb +4 -0
  38. data/lib/rpush/daemon/rpc.rb +9 -0
  39. data/lib/rpush/daemon/rpc/client.rb +27 -0
  40. data/lib/rpush/daemon/rpc/server.rb +82 -0
  41. data/lib/rpush/daemon/signal_handler.rb +7 -0
  42. data/lib/rpush/daemon/store/active_record.rb +17 -3
  43. data/lib/rpush/daemon/store/mongoid.rb +2 -2
  44. data/lib/rpush/daemon/store/redis.rb +2 -2
  45. data/lib/rpush/daemon/tcp_connection.rb +2 -2
  46. data/lib/rpush/daemon/wns.rb +9 -0
  47. data/lib/rpush/daemon/wns/delivery.rb +204 -0
  48. data/lib/rpush/embed.rb +15 -13
  49. data/lib/rpush/logger.rb +4 -0
  50. data/lib/rpush/plugin.rb +1 -1
  51. data/lib/rpush/push.rb +2 -11
  52. data/lib/rpush/reflection_collection.rb +15 -17
  53. data/lib/rpush/reflection_public_methods.rb +6 -4
  54. data/lib/rpush/version.rb +1 -1
  55. data/spec/functional/apns_spec.rb +1 -11
  56. data/spec/functional/cli_spec.rb +36 -0
  57. data/spec/functional_spec_helper.rb +11 -1
  58. data/spec/spec_helper.rb +4 -3
  59. data/spec/support/active_record_setup.rb +3 -2
  60. data/spec/unit/client/active_record/apns/notification_spec.rb +1 -1
  61. data/spec/unit/client/active_record/gcm/notification_spec.rb +5 -0
  62. data/spec/unit/configuration_spec.rb +0 -7
  63. data/spec/unit/daemon/adm/delivery_spec.rb +2 -2
  64. data/spec/unit/daemon/app_runner_spec.rb +2 -3
  65. data/spec/unit/daemon/gcm/delivery_spec.rb +1 -1
  66. data/spec/unit/daemon/tcp_connection_spec.rb +1 -1
  67. data/spec/unit/daemon/wns/delivery_spec.rb +171 -0
  68. data/spec/unit/daemon/wpns/delivery_spec.rb +1 -1
  69. data/spec/unit/daemon_spec.rb +2 -0
  70. data/spec/unit/embed_spec.rb +4 -11
  71. data/spec/unit/logger_spec.rb +2 -2
  72. data/spec/unit/push_spec.rb +0 -7
  73. data/spec/unit_spec_helper.rb +1 -1
  74. metadata +20 -2
@@ -16,7 +16,7 @@ describe Rpush::Daemon::Wpns::Delivery do
16
16
  end
17
17
 
18
18
  def perform_with_rescue
19
- expect { perform }.to raise_error
19
+ expect { perform }.to raise_error(StandardError)
20
20
  end
21
21
 
22
22
  before do
@@ -13,6 +13,8 @@ describe Rpush::Daemon, "when starting" do
13
13
  allow(Rpush::Daemon::Feeder).to receive(:start)
14
14
  allow(Rpush::Daemon::Synchronizer).to receive(:sync)
15
15
  allow(Rpush::Daemon::AppRunner).to receive(:stop)
16
+ allow(Rpush::Daemon::Rpc::Server).to receive(:start)
17
+ allow(Rpush::Daemon::Rpc::Server).to receive(:stop)
16
18
  allow(Rpush::Daemon).to receive(:exit)
17
19
  allow(Rpush::Daemon).to receive(:puts)
18
20
  allow(Rpush::Daemon::SignalHandler).to receive(:start)
@@ -17,13 +17,6 @@ describe Rpush, 'embed' do
17
17
  expect(Rpush::Daemon).to receive(:start)
18
18
  Rpush.embed
19
19
  end
20
-
21
- it 'overrides the default config options with those given as a hash' do
22
- Rpush::Deprecation.muted do
23
- Rpush.config.push_poll = 4
24
- expect { Rpush.embed(push_poll: 2) }.to change(Rpush.config, :push_poll).to(2)
25
- end
26
- end
27
20
  end
28
21
 
29
22
  describe Rpush, 'shutdown' do
@@ -44,11 +37,11 @@ describe Rpush, 'sync' do
44
37
  end
45
38
  end
46
39
 
47
- describe Rpush, 'debug' do
40
+ describe Rpush, 'status' do
48
41
  before { Rpush.config.embedded = true }
49
42
 
50
- it 'debugs the AppRunner' do
51
- expect(Rpush::Daemon::AppRunner).to receive(:debug)
52
- Rpush.debug
43
+ it 'returns the AppRunner status' do
44
+ expect(Rpush::Daemon::AppRunner).to receive_messages(status: { status: true })
45
+ expect(Rpush.status).to eq(status: true)
53
46
  end
54
47
  end
@@ -58,14 +58,14 @@ describe Rpush::Logger do
58
58
 
59
59
  it 'uses ActiveSupport::Logger if BufferedLogger does not exist' do
60
60
  stub_const('ActiveSupport::Logger', double)
61
- allow(ActiveSupport).to receive_messages(:const_defined? => false)
61
+ allow(ActiveSupport).to receive_messages(const_defined?: false)
62
62
  expect(ActiveSupport::Logger).to receive(:new).with(log).and_return(log)
63
63
  Rpush::Logger.new
64
64
  end
65
65
 
66
66
  it 'sets the log level on the logger' do
67
67
  stub_const('ActiveSupport::Logger', double)
68
- allow(ActiveSupport).to receive_messages(:const_defined? => false)
68
+ allow(ActiveSupport).to receive_messages(const_defined?: false)
69
69
  expect(ActiveSupport::Logger).to receive(:new).with(log).and_return(log)
70
70
  Rpush.config.log_level = ::Logger::Severity::ERROR
71
71
  expect(log).to receive(:level=).with(::Logger::Severity::ERROR)
@@ -31,11 +31,4 @@ describe Rpush, 'push' do
31
31
  expect(Rpush::Daemon::AppRunner).to receive(:stop)
32
32
  Rpush.push
33
33
  end
34
-
35
- it 'overrides the default config options with those given as a hash' do
36
- Rpush::Deprecation.muted do
37
- Rpush.config.batch_size = 20
38
- expect { Rpush.push(batch_size: 10) }.to change(Rpush.config, :batch_size).to(10)
39
- end
40
- end
41
34
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'rails'
3
3
 
4
4
  def unit_example?(metadata)
5
- metadata[:file_path] =~ /spec\/unit/
5
+ metadata[:file_path] =~ %r{spec/unit}
6
6
  end
7
7
 
8
8
  def 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.4.0
4
+ version: 2.6.0
5
5
  platform: java
6
6
  authors:
7
7
  - Ian Leitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-18 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,7 @@ files:
156
156
  - lib/generators/templates/rpush.rb
157
157
  - lib/generators/templates/rpush_2_0_0_updates.rb
158
158
  - lib/generators/templates/rpush_2_1_0_updates.rb
159
+ - lib/generators/templates/rpush_2_6_0_updates.rb
159
160
  - lib/rpush.rb
160
161
  - lib/rpush/apns_feedback.rb
161
162
  - lib/rpush/cli.rb
@@ -173,6 +174,8 @@ files:
173
174
  - lib/rpush/client/active_model/notification.rb
174
175
  - lib/rpush/client/active_model/payload_data_size_validator.rb
175
176
  - lib/rpush/client/active_model/registration_ids_count_validator.rb
177
+ - lib/rpush/client/active_model/wns/app.rb
178
+ - lib/rpush/client/active_model/wns/notification.rb
176
179
  - lib/rpush/client/active_model/wpns/app.rb
177
180
  - lib/rpush/client/active_model/wpns/notification.rb
178
181
  - lib/rpush/client/active_record.rb
@@ -185,6 +188,8 @@ files:
185
188
  - lib/rpush/client/active_record/gcm/app.rb
186
189
  - lib/rpush/client/active_record/gcm/notification.rb
187
190
  - lib/rpush/client/active_record/notification.rb
191
+ - lib/rpush/client/active_record/wns/app.rb
192
+ - lib/rpush/client/active_record/wns/notification.rb
188
193
  - lib/rpush/client/active_record/wpns/app.rb
189
194
  - lib/rpush/client/active_record/wpns/notification.rb
190
195
  - lib/rpush/client/mongoid.rb
@@ -197,6 +202,8 @@ files:
197
202
  - lib/rpush/client/mongoid/gcm/app.rb
198
203
  - lib/rpush/client/mongoid/gcm/notification.rb
199
204
  - lib/rpush/client/mongoid/notification.rb
205
+ - lib/rpush/client/mongoid/wns/app.rb
206
+ - lib/rpush/client/mongoid/wns/notification.rb
200
207
  - lib/rpush/client/mongoid/wpns/app.rb
201
208
  - lib/rpush/client/mongoid/wpns/notification.rb
202
209
  - lib/rpush/client/redis.rb
@@ -209,6 +216,8 @@ files:
209
216
  - lib/rpush/client/redis/gcm/app.rb
210
217
  - lib/rpush/client/redis/gcm/notification.rb
211
218
  - lib/rpush/client/redis/notification.rb
219
+ - lib/rpush/client/redis/wns/app.rb
220
+ - lib/rpush/client/redis/wns/notification.rb
212
221
  - lib/rpush/client/redis/wpns/app.rb
213
222
  - lib/rpush/client/redis/wpns/notification.rb
214
223
  - lib/rpush/configuration.rb
@@ -238,6 +247,9 @@ files:
238
247
  - lib/rpush/daemon/retry_header_parser.rb
239
248
  - lib/rpush/daemon/retryable_error.rb
240
249
  - lib/rpush/daemon/ring_buffer.rb
250
+ - lib/rpush/daemon/rpc.rb
251
+ - lib/rpush/daemon/rpc/client.rb
252
+ - lib/rpush/daemon/rpc/server.rb
241
253
  - lib/rpush/daemon/service_config_methods.rb
242
254
  - lib/rpush/daemon/signal_handler.rb
243
255
  - lib/rpush/daemon/store/active_record.rb
@@ -248,6 +260,8 @@ files:
248
260
  - lib/rpush/daemon/string_helpers.rb
249
261
  - lib/rpush/daemon/synchronizer.rb
250
262
  - lib/rpush/daemon/tcp_connection.rb
263
+ - lib/rpush/daemon/wns.rb
264
+ - lib/rpush/daemon/wns/delivery.rb
251
265
  - lib/rpush/daemon/wpns.rb
252
266
  - lib/rpush/daemon/wpns/delivery.rb
253
267
  - lib/rpush/deprecatable.rb
@@ -266,6 +280,7 @@ files:
266
280
  - spec/.rubocop.yml
267
281
  - spec/functional/adm_spec.rb
268
282
  - spec/functional/apns_spec.rb
283
+ - spec/functional/cli_spec.rb
269
284
  - spec/functional/embed_spec.rb
270
285
  - spec/functional/gcm_spec.rb
271
286
  - spec/functional/new_app_spec.rb
@@ -318,6 +333,7 @@ files:
318
333
  - spec/unit/daemon/store/mongoid_spec.rb
319
334
  - spec/unit/daemon/store/redis_spec.rb
320
335
  - spec/unit/daemon/tcp_connection_spec.rb
336
+ - spec/unit/daemon/wns/delivery_spec.rb
321
337
  - spec/unit/daemon/wpns/delivery_spec.rb
322
338
  - spec/unit/daemon_spec.rb
323
339
  - spec/unit/deprecatable_spec.rb
@@ -359,6 +375,7 @@ test_files:
359
375
  - spec/.rubocop.yml
360
376
  - spec/functional/adm_spec.rb
361
377
  - spec/functional/apns_spec.rb
378
+ - spec/functional/cli_spec.rb
362
379
  - spec/functional/embed_spec.rb
363
380
  - spec/functional/gcm_spec.rb
364
381
  - spec/functional/new_app_spec.rb
@@ -411,6 +428,7 @@ test_files:
411
428
  - spec/unit/daemon/store/mongoid_spec.rb
412
429
  - spec/unit/daemon/store/redis_spec.rb
413
430
  - spec/unit/daemon/tcp_connection_spec.rb
431
+ - spec/unit/daemon/wns/delivery_spec.rb
414
432
  - spec/unit/daemon/wpns/delivery_spec.rb
415
433
  - spec/unit/daemon_spec.rb
416
434
  - spec/unit/deprecatable_spec.rb