rpush 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +11 -7
  4. data/lib/generators/templates/rpush.rb +8 -2
  5. data/lib/generators/templates/rpush_2_0_0_updates.rb +1 -1
  6. data/lib/rpush/cli.rb +61 -27
  7. data/lib/rpush/client/active_model.rb +3 -0
  8. data/lib/rpush/client/active_model/apns/notification.rb +1 -1
  9. data/lib/rpush/client/active_model/wns/app.rb +23 -0
  10. data/lib/rpush/client/active_model/wns/notification.rb +28 -0
  11. data/lib/rpush/client/active_model/wpns/notification.rb +11 -6
  12. data/lib/rpush/client/active_record.rb +3 -0
  13. data/lib/rpush/client/active_record/wns/app.rb +11 -0
  14. data/lib/rpush/client/active_record/wns/notification.rb +11 -0
  15. data/lib/rpush/client/mongoid.rb +3 -0
  16. data/lib/rpush/client/mongoid/apns/feedback.rb +3 -0
  17. data/lib/rpush/client/mongoid/notification.rb +6 -0
  18. data/lib/rpush/client/mongoid/wns/app.rb +14 -0
  19. data/lib/rpush/client/mongoid/wns/notification.rb +11 -0
  20. data/lib/rpush/client/redis.rb +3 -0
  21. data/lib/rpush/client/redis/wns/app.rb +14 -0
  22. data/lib/rpush/client/redis/wns/notification.rb +11 -0
  23. data/lib/rpush/configuration.rb +3 -7
  24. data/lib/rpush/daemon.rb +9 -0
  25. data/lib/rpush/daemon/apns/feedback_receiver.rb +5 -0
  26. data/lib/rpush/daemon/app_runner.rb +4 -5
  27. data/lib/rpush/daemon/dispatcher/apns_tcp.rb +47 -12
  28. data/lib/rpush/daemon/dispatcher_loop.rb +5 -0
  29. data/lib/rpush/daemon/feeder.rb +11 -0
  30. data/lib/rpush/daemon/interruptible_sleep.rb +8 -3
  31. data/lib/rpush/daemon/loggable.rb +4 -0
  32. data/lib/rpush/daemon/rpc.rb +9 -0
  33. data/lib/rpush/daemon/rpc/client.rb +27 -0
  34. data/lib/rpush/daemon/rpc/server.rb +82 -0
  35. data/lib/rpush/daemon/signal_handler.rb +7 -0
  36. data/lib/rpush/daemon/store/active_record.rb +17 -3
  37. data/lib/rpush/daemon/store/mongoid.rb +2 -2
  38. data/lib/rpush/daemon/store/redis.rb +2 -2
  39. data/lib/rpush/daemon/tcp_connection.rb +2 -2
  40. data/lib/rpush/daemon/wns.rb +9 -0
  41. data/lib/rpush/daemon/wns/delivery.rb +206 -0
  42. data/lib/rpush/embed.rb +15 -13
  43. data/lib/rpush/logger.rb +4 -0
  44. data/lib/rpush/plugin.rb +1 -1
  45. data/lib/rpush/push.rb +2 -11
  46. data/lib/rpush/reflection_collection.rb +15 -17
  47. data/lib/rpush/reflection_public_methods.rb +6 -4
  48. data/lib/rpush/version.rb +1 -1
  49. data/spec/functional/apns_spec.rb +1 -11
  50. data/spec/functional/cli_spec.rb +35 -0
  51. data/spec/functional_spec_helper.rb +11 -1
  52. data/spec/spec_helper.rb +4 -3
  53. data/spec/support/active_record_setup.rb +1 -1
  54. data/spec/unit/client/active_record/apns/notification_spec.rb +1 -1
  55. data/spec/unit/configuration_spec.rb +0 -7
  56. data/spec/unit/daemon/adm/delivery_spec.rb +2 -2
  57. data/spec/unit/daemon/app_runner_spec.rb +2 -3
  58. data/spec/unit/daemon/gcm/delivery_spec.rb +1 -1
  59. data/spec/unit/daemon/tcp_connection_spec.rb +1 -1
  60. data/spec/unit/daemon/wns/delivery_spec.rb +171 -0
  61. data/spec/unit/daemon/wpns/delivery_spec.rb +1 -1
  62. data/spec/unit/daemon_spec.rb +2 -0
  63. data/spec/unit/embed_spec.rb +4 -11
  64. data/spec/unit/logger_spec.rb +2 -2
  65. data/spec/unit/push_spec.rb +0 -7
  66. data/spec/unit_spec_helper.rb +1 -1
  67. metadata +20 -3
@@ -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.5.0
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-02-18 00:00:00.000000000 Z
11
+ date: 2015-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -145,6 +145,8 @@ files:
145
145
  - lib/rpush/client/active_model/notification.rb
146
146
  - lib/rpush/client/active_model/payload_data_size_validator.rb
147
147
  - lib/rpush/client/active_model/registration_ids_count_validator.rb
148
+ - lib/rpush/client/active_model/wns/app.rb
149
+ - lib/rpush/client/active_model/wns/notification.rb
148
150
  - lib/rpush/client/active_model/wpns/app.rb
149
151
  - lib/rpush/client/active_model/wpns/notification.rb
150
152
  - lib/rpush/client/active_record.rb
@@ -157,6 +159,8 @@ files:
157
159
  - lib/rpush/client/active_record/gcm/app.rb
158
160
  - lib/rpush/client/active_record/gcm/notification.rb
159
161
  - lib/rpush/client/active_record/notification.rb
162
+ - lib/rpush/client/active_record/wns/app.rb
163
+ - lib/rpush/client/active_record/wns/notification.rb
160
164
  - lib/rpush/client/active_record/wpns/app.rb
161
165
  - lib/rpush/client/active_record/wpns/notification.rb
162
166
  - lib/rpush/client/mongoid.rb
@@ -169,6 +173,8 @@ files:
169
173
  - lib/rpush/client/mongoid/gcm/app.rb
170
174
  - lib/rpush/client/mongoid/gcm/notification.rb
171
175
  - lib/rpush/client/mongoid/notification.rb
176
+ - lib/rpush/client/mongoid/wns/app.rb
177
+ - lib/rpush/client/mongoid/wns/notification.rb
172
178
  - lib/rpush/client/mongoid/wpns/app.rb
173
179
  - lib/rpush/client/mongoid/wpns/notification.rb
174
180
  - lib/rpush/client/redis.rb
@@ -181,6 +187,8 @@ files:
181
187
  - lib/rpush/client/redis/gcm/app.rb
182
188
  - lib/rpush/client/redis/gcm/notification.rb
183
189
  - lib/rpush/client/redis/notification.rb
190
+ - lib/rpush/client/redis/wns/app.rb
191
+ - lib/rpush/client/redis/wns/notification.rb
184
192
  - lib/rpush/client/redis/wpns/app.rb
185
193
  - lib/rpush/client/redis/wpns/notification.rb
186
194
  - lib/rpush/configuration.rb
@@ -210,6 +218,9 @@ files:
210
218
  - lib/rpush/daemon/retry_header_parser.rb
211
219
  - lib/rpush/daemon/retryable_error.rb
212
220
  - lib/rpush/daemon/ring_buffer.rb
221
+ - lib/rpush/daemon/rpc.rb
222
+ - lib/rpush/daemon/rpc/client.rb
223
+ - lib/rpush/daemon/rpc/server.rb
213
224
  - lib/rpush/daemon/service_config_methods.rb
214
225
  - lib/rpush/daemon/signal_handler.rb
215
226
  - lib/rpush/daemon/store/active_record.rb
@@ -220,6 +231,8 @@ files:
220
231
  - lib/rpush/daemon/string_helpers.rb
221
232
  - lib/rpush/daemon/synchronizer.rb
222
233
  - lib/rpush/daemon/tcp_connection.rb
234
+ - lib/rpush/daemon/wns.rb
235
+ - lib/rpush/daemon/wns/delivery.rb
223
236
  - lib/rpush/daemon/wpns.rb
224
237
  - lib/rpush/daemon/wpns/delivery.rb
225
238
  - lib/rpush/deprecatable.rb
@@ -238,6 +251,7 @@ files:
238
251
  - spec/.rubocop.yml
239
252
  - spec/functional/adm_spec.rb
240
253
  - spec/functional/apns_spec.rb
254
+ - spec/functional/cli_spec.rb
241
255
  - spec/functional/embed_spec.rb
242
256
  - spec/functional/gcm_spec.rb
243
257
  - spec/functional/new_app_spec.rb
@@ -290,6 +304,7 @@ files:
290
304
  - spec/unit/daemon/store/mongoid_spec.rb
291
305
  - spec/unit/daemon/store/redis_spec.rb
292
306
  - spec/unit/daemon/tcp_connection_spec.rb
307
+ - spec/unit/daemon/wns/delivery_spec.rb
293
308
  - spec/unit/daemon/wpns/delivery_spec.rb
294
309
  - spec/unit/daemon_spec.rb
295
310
  - spec/unit/deprecatable_spec.rb
@@ -323,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
338
  version: '0'
324
339
  requirements: []
325
340
  rubyforge_project:
326
- rubygems_version: 2.4.5
341
+ rubygems_version: 2.4.8
327
342
  signing_key:
328
343
  specification_version: 4
329
344
  summary: The push notification service for Ruby.
@@ -331,6 +346,7 @@ test_files:
331
346
  - spec/.rubocop.yml
332
347
  - spec/functional/adm_spec.rb
333
348
  - spec/functional/apns_spec.rb
349
+ - spec/functional/cli_spec.rb
334
350
  - spec/functional/embed_spec.rb
335
351
  - spec/functional/gcm_spec.rb
336
352
  - spec/functional/new_app_spec.rb
@@ -383,6 +399,7 @@ test_files:
383
399
  - spec/unit/daemon/store/mongoid_spec.rb
384
400
  - spec/unit/daemon/store/redis_spec.rb
385
401
  - spec/unit/daemon/tcp_connection_spec.rb
402
+ - spec/unit/daemon/wns/delivery_spec.rb
386
403
  - spec/unit/daemon/wpns/delivery_spec.rb
387
404
  - spec/unit/daemon_spec.rb
388
405
  - spec/unit/deprecatable_spec.rb