rpush 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -2
- data/lib/rpush/cli.rb +1 -1
- data/lib/rpush/client/active_model.rb +1 -1
- data/lib/rpush/client/active_model/apns/notification.rb +9 -1
- data/lib/rpush/client/active_model/apns/notification_payload_size_validator.rb +15 -0
- data/lib/rpush/client/active_model/apns2/notification.rb +14 -0
- data/lib/rpush/client/active_record.rb +1 -0
- data/lib/rpush/client/active_record/apns/active_record_serializable_notification.rb +65 -0
- data/lib/rpush/client/active_record/apns/notification.rb +1 -57
- data/lib/rpush/client/active_record/apns2/notification.rb +4 -1
- data/lib/rpush/client/redis/apns2/notification.rb +1 -0
- data/lib/rpush/client/redis/pushy/notification.rb +0 -1
- data/lib/rpush/daemon/apns2/delivery.rb +6 -1
- data/lib/rpush/daemon/apnsp8/delivery.rb +7 -2
- data/lib/rpush/daemon/store/active_record/reconnectable.rb +1 -1
- data/lib/rpush/version.rb +1 -1
- data/spec/functional/apns2_spec.rb +36 -0
- data/spec/support/simplecov_helper.rb +1 -1
- data/spec/unit/client/active_record/adm/app_spec.rb +2 -54
- data/spec/unit/client/active_record/adm/notification_spec.rb +2 -39
- data/spec/unit/client/active_record/apns/app_spec.rb +3 -26
- data/spec/unit/client/active_record/apns/feedback_spec.rb +1 -5
- data/spec/unit/client/active_record/apns/notification_spec.rb +29 -293
- data/spec/unit/client/active_record/apns2/app_spec.rb +4 -0
- data/spec/unit/client/active_record/apns2/notification_spec.rb +65 -0
- data/spec/unit/client/active_record/app_spec.rb +1 -26
- data/spec/unit/client/active_record/gcm/app_spec.rb +3 -1
- data/spec/unit/client/active_record/gcm/notification_spec.rb +6 -88
- data/spec/unit/client/active_record/notification_spec.rb +3 -11
- data/spec/unit/client/active_record/pushy/app_spec.rb +2 -13
- data/spec/unit/client/active_record/pushy/notification_spec.rb +2 -55
- data/spec/unit/client/active_record/shared/app.rb +14 -0
- data/spec/unit/{notification_shared.rb → client/active_record/shared/notification.rb} +12 -7
- data/spec/unit/client/active_record/wns/badge_notification_spec.rb +1 -11
- data/spec/unit/client/active_record/wns/raw_notification_spec.rb +3 -12
- data/spec/unit/client/active_record/wpns/app_spec.rb +3 -1
- data/spec/unit/client/active_record/wpns/notification_spec.rb +2 -17
- data/spec/unit/client/redis/adm/app_spec.rb +5 -0
- data/spec/unit/client/redis/adm/notification_spec.rb +5 -0
- data/spec/unit/client/redis/apns/app_spec.rb +5 -0
- data/spec/unit/client/redis/apns/feedback_spec.rb +5 -0
- data/spec/unit/client/redis/apns/notification_spec.rb +50 -0
- data/spec/unit/client/redis/apns2/app_spec.rb +4 -0
- data/spec/unit/client/redis/apns2/notification_spec.rb +50 -0
- data/spec/unit/client/redis/app_spec.rb +5 -0
- data/spec/unit/client/redis/gcm/app_spec.rb +5 -0
- data/spec/unit/client/redis/gcm/notification_spec.rb +5 -0
- data/spec/unit/client/redis/notification_spec.rb +5 -0
- data/spec/unit/client/redis/pushy/app_spec.rb +5 -0
- data/spec/unit/client/redis/pushy/notification_spec.rb +5 -0
- data/spec/unit/client/redis/wns/badge_notification_spec.rb +5 -0
- data/spec/unit/client/redis/wns/raw_notification_spec.rb +22 -0
- data/spec/unit/client/redis/wpns/app_spec.rb +5 -0
- data/spec/unit/client/redis/wpns/notification_spec.rb +5 -0
- data/spec/unit/client/shared/adm/app.rb +51 -0
- data/spec/unit/client/shared/adm/notification.rb +39 -0
- data/spec/unit/client/shared/apns/app.rb +29 -0
- data/spec/unit/client/shared/apns/feedback.rb +9 -0
- data/spec/unit/client/shared/apns/notification.rb +262 -0
- data/spec/unit/client/shared/app.rb +17 -0
- data/spec/unit/client/shared/gcm/app.rb +4 -0
- data/spec/unit/client/shared/gcm/notification.rb +77 -0
- data/spec/unit/client/shared/notification.rb +10 -0
- data/spec/unit/client/shared/pushy/app.rb +17 -0
- data/spec/unit/client/shared/pushy/notification.rb +55 -0
- data/spec/unit/client/shared/wns/badge_notification.rb +15 -0
- data/spec/unit/client/shared/wns/raw_notification.rb +21 -0
- data/spec/unit/client/shared/wpns/app.rb +4 -0
- data/spec/unit/client/shared/wpns/notification.rb +18 -0
- data/spec/unit/daemon/shared/store.rb +312 -0
- data/spec/unit/daemon/store/active_record/reconnectable_spec.rb +7 -7
- data/spec/unit/daemon/store/active_record_spec.rb +2 -290
- data/spec/unit/daemon/store/redis_spec.rb +2 -291
- data/spec/unit_spec_helper.rb +3 -0
- metadata +89 -10
- data/lib/rpush/client/active_model/apns/binary_notification_validator.rb +0 -16
data/spec/unit_spec_helper.rb
CHANGED
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: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Leitch
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -44,14 +44,20 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.18'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.18.3
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
55
|
- - "~>"
|
53
56
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
57
|
+
version: '0.18'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.18.3
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: jwt
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -401,9 +407,9 @@ files:
|
|
401
407
|
- lib/rpush/client/active_model/adm/data_validator.rb
|
402
408
|
- lib/rpush/client/active_model/adm/notification.rb
|
403
409
|
- lib/rpush/client/active_model/apns/app.rb
|
404
|
-
- lib/rpush/client/active_model/apns/binary_notification_validator.rb
|
405
410
|
- lib/rpush/client/active_model/apns/device_token_format_validator.rb
|
406
411
|
- lib/rpush/client/active_model/apns/notification.rb
|
412
|
+
- lib/rpush/client/active_model/apns/notification_payload_size_validator.rb
|
407
413
|
- lib/rpush/client/active_model/apns2/app.rb
|
408
414
|
- lib/rpush/client/active_model/apns2/notification.rb
|
409
415
|
- lib/rpush/client/active_model/apnsp8/app.rb
|
@@ -424,6 +430,7 @@ files:
|
|
424
430
|
- lib/rpush/client/active_record.rb
|
425
431
|
- lib/rpush/client/active_record/adm/app.rb
|
426
432
|
- lib/rpush/client/active_record/adm/notification.rb
|
433
|
+
- lib/rpush/client/active_record/apns/active_record_serializable_notification.rb
|
427
434
|
- lib/rpush/client/active_record/apns/app.rb
|
428
435
|
- lib/rpush/client/active_record/apns/feedback.rb
|
429
436
|
- lib/rpush/client/active_record/apns/notification.rb
|
@@ -561,16 +568,52 @@ files:
|
|
561
568
|
- spec/unit/client/active_record/apns/app_spec.rb
|
562
569
|
- spec/unit/client/active_record/apns/feedback_spec.rb
|
563
570
|
- spec/unit/client/active_record/apns/notification_spec.rb
|
571
|
+
- spec/unit/client/active_record/apns2/app_spec.rb
|
572
|
+
- spec/unit/client/active_record/apns2/notification_spec.rb
|
564
573
|
- spec/unit/client/active_record/app_spec.rb
|
565
574
|
- spec/unit/client/active_record/gcm/app_spec.rb
|
566
575
|
- spec/unit/client/active_record/gcm/notification_spec.rb
|
567
576
|
- spec/unit/client/active_record/notification_spec.rb
|
568
577
|
- spec/unit/client/active_record/pushy/app_spec.rb
|
569
578
|
- spec/unit/client/active_record/pushy/notification_spec.rb
|
579
|
+
- spec/unit/client/active_record/shared/app.rb
|
580
|
+
- spec/unit/client/active_record/shared/notification.rb
|
570
581
|
- spec/unit/client/active_record/wns/badge_notification_spec.rb
|
571
582
|
- spec/unit/client/active_record/wns/raw_notification_spec.rb
|
572
583
|
- spec/unit/client/active_record/wpns/app_spec.rb
|
573
584
|
- spec/unit/client/active_record/wpns/notification_spec.rb
|
585
|
+
- spec/unit/client/redis/adm/app_spec.rb
|
586
|
+
- spec/unit/client/redis/adm/notification_spec.rb
|
587
|
+
- spec/unit/client/redis/apns/app_spec.rb
|
588
|
+
- spec/unit/client/redis/apns/feedback_spec.rb
|
589
|
+
- spec/unit/client/redis/apns/notification_spec.rb
|
590
|
+
- spec/unit/client/redis/apns2/app_spec.rb
|
591
|
+
- spec/unit/client/redis/apns2/notification_spec.rb
|
592
|
+
- spec/unit/client/redis/app_spec.rb
|
593
|
+
- spec/unit/client/redis/gcm/app_spec.rb
|
594
|
+
- spec/unit/client/redis/gcm/notification_spec.rb
|
595
|
+
- spec/unit/client/redis/notification_spec.rb
|
596
|
+
- spec/unit/client/redis/pushy/app_spec.rb
|
597
|
+
- spec/unit/client/redis/pushy/notification_spec.rb
|
598
|
+
- spec/unit/client/redis/wns/badge_notification_spec.rb
|
599
|
+
- spec/unit/client/redis/wns/raw_notification_spec.rb
|
600
|
+
- spec/unit/client/redis/wpns/app_spec.rb
|
601
|
+
- spec/unit/client/redis/wpns/notification_spec.rb
|
602
|
+
- spec/unit/client/shared/adm/app.rb
|
603
|
+
- spec/unit/client/shared/adm/notification.rb
|
604
|
+
- spec/unit/client/shared/apns/app.rb
|
605
|
+
- spec/unit/client/shared/apns/feedback.rb
|
606
|
+
- spec/unit/client/shared/apns/notification.rb
|
607
|
+
- spec/unit/client/shared/app.rb
|
608
|
+
- spec/unit/client/shared/gcm/app.rb
|
609
|
+
- spec/unit/client/shared/gcm/notification.rb
|
610
|
+
- spec/unit/client/shared/notification.rb
|
611
|
+
- spec/unit/client/shared/pushy/app.rb
|
612
|
+
- spec/unit/client/shared/pushy/notification.rb
|
613
|
+
- spec/unit/client/shared/wns/badge_notification.rb
|
614
|
+
- spec/unit/client/shared/wns/raw_notification.rb
|
615
|
+
- spec/unit/client/shared/wpns/app.rb
|
616
|
+
- spec/unit/client/shared/wpns/notification.rb
|
574
617
|
- spec/unit/configuration_spec.rb
|
575
618
|
- spec/unit/daemon/adm/delivery_spec.rb
|
576
619
|
- spec/unit/daemon/apns/certificate_expired_error_spec.rb
|
@@ -589,6 +632,7 @@ files:
|
|
589
632
|
- spec/unit/daemon/pushy/delivery_spec.rb
|
590
633
|
- spec/unit/daemon/retryable_error_spec.rb
|
591
634
|
- spec/unit/daemon/service_config_methods_spec.rb
|
635
|
+
- spec/unit/daemon/shared/store.rb
|
592
636
|
- spec/unit/daemon/signal_handler_spec.rb
|
593
637
|
- spec/unit/daemon/store/active_record/reconnectable_spec.rb
|
594
638
|
- spec/unit/daemon/store/active_record_spec.rb
|
@@ -602,7 +646,6 @@ files:
|
|
602
646
|
- spec/unit/deprecation_spec.rb
|
603
647
|
- spec/unit/embed_spec.rb
|
604
648
|
- spec/unit/logger_spec.rb
|
605
|
-
- spec/unit/notification_shared.rb
|
606
649
|
- spec/unit/plugin_spec.rb
|
607
650
|
- spec/unit/push_spec.rb
|
608
651
|
- spec/unit/reflectable_spec.rb
|
@@ -635,8 +678,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
635
678
|
- !ruby/object:Gem::Version
|
636
679
|
version: '0'
|
637
680
|
requirements: []
|
638
|
-
rubygems_version: 3.1.
|
639
|
-
signing_key:
|
681
|
+
rubygems_version: 3.1.4
|
682
|
+
signing_key:
|
640
683
|
specification_version: 4
|
641
684
|
summary: The push notification service for Ruby.
|
642
685
|
test_files:
|
@@ -668,16 +711,52 @@ test_files:
|
|
668
711
|
- spec/unit/client/active_record/apns/app_spec.rb
|
669
712
|
- spec/unit/client/active_record/apns/feedback_spec.rb
|
670
713
|
- spec/unit/client/active_record/apns/notification_spec.rb
|
714
|
+
- spec/unit/client/active_record/apns2/app_spec.rb
|
715
|
+
- spec/unit/client/active_record/apns2/notification_spec.rb
|
671
716
|
- spec/unit/client/active_record/app_spec.rb
|
672
717
|
- spec/unit/client/active_record/gcm/app_spec.rb
|
673
718
|
- spec/unit/client/active_record/gcm/notification_spec.rb
|
674
719
|
- spec/unit/client/active_record/notification_spec.rb
|
675
720
|
- spec/unit/client/active_record/pushy/app_spec.rb
|
676
721
|
- spec/unit/client/active_record/pushy/notification_spec.rb
|
722
|
+
- spec/unit/client/active_record/shared/app.rb
|
723
|
+
- spec/unit/client/active_record/shared/notification.rb
|
677
724
|
- spec/unit/client/active_record/wns/badge_notification_spec.rb
|
678
725
|
- spec/unit/client/active_record/wns/raw_notification_spec.rb
|
679
726
|
- spec/unit/client/active_record/wpns/app_spec.rb
|
680
727
|
- spec/unit/client/active_record/wpns/notification_spec.rb
|
728
|
+
- spec/unit/client/redis/adm/app_spec.rb
|
729
|
+
- spec/unit/client/redis/adm/notification_spec.rb
|
730
|
+
- spec/unit/client/redis/apns/app_spec.rb
|
731
|
+
- spec/unit/client/redis/apns/feedback_spec.rb
|
732
|
+
- spec/unit/client/redis/apns/notification_spec.rb
|
733
|
+
- spec/unit/client/redis/apns2/app_spec.rb
|
734
|
+
- spec/unit/client/redis/apns2/notification_spec.rb
|
735
|
+
- spec/unit/client/redis/app_spec.rb
|
736
|
+
- spec/unit/client/redis/gcm/app_spec.rb
|
737
|
+
- spec/unit/client/redis/gcm/notification_spec.rb
|
738
|
+
- spec/unit/client/redis/notification_spec.rb
|
739
|
+
- spec/unit/client/redis/pushy/app_spec.rb
|
740
|
+
- spec/unit/client/redis/pushy/notification_spec.rb
|
741
|
+
- spec/unit/client/redis/wns/badge_notification_spec.rb
|
742
|
+
- spec/unit/client/redis/wns/raw_notification_spec.rb
|
743
|
+
- spec/unit/client/redis/wpns/app_spec.rb
|
744
|
+
- spec/unit/client/redis/wpns/notification_spec.rb
|
745
|
+
- spec/unit/client/shared/adm/app.rb
|
746
|
+
- spec/unit/client/shared/adm/notification.rb
|
747
|
+
- spec/unit/client/shared/apns/app.rb
|
748
|
+
- spec/unit/client/shared/apns/feedback.rb
|
749
|
+
- spec/unit/client/shared/apns/notification.rb
|
750
|
+
- spec/unit/client/shared/app.rb
|
751
|
+
- spec/unit/client/shared/gcm/app.rb
|
752
|
+
- spec/unit/client/shared/gcm/notification.rb
|
753
|
+
- spec/unit/client/shared/notification.rb
|
754
|
+
- spec/unit/client/shared/pushy/app.rb
|
755
|
+
- spec/unit/client/shared/pushy/notification.rb
|
756
|
+
- spec/unit/client/shared/wns/badge_notification.rb
|
757
|
+
- spec/unit/client/shared/wns/raw_notification.rb
|
758
|
+
- spec/unit/client/shared/wpns/app.rb
|
759
|
+
- spec/unit/client/shared/wpns/notification.rb
|
681
760
|
- spec/unit/configuration_spec.rb
|
682
761
|
- spec/unit/daemon/adm/delivery_spec.rb
|
683
762
|
- spec/unit/daemon/apns/certificate_expired_error_spec.rb
|
@@ -696,6 +775,7 @@ test_files:
|
|
696
775
|
- spec/unit/daemon/pushy/delivery_spec.rb
|
697
776
|
- spec/unit/daemon/retryable_error_spec.rb
|
698
777
|
- spec/unit/daemon/service_config_methods_spec.rb
|
778
|
+
- spec/unit/daemon/shared/store.rb
|
699
779
|
- spec/unit/daemon/signal_handler_spec.rb
|
700
780
|
- spec/unit/daemon/store/active_record/reconnectable_spec.rb
|
701
781
|
- spec/unit/daemon/store/active_record_spec.rb
|
@@ -709,7 +789,6 @@ test_files:
|
|
709
789
|
- spec/unit/deprecation_spec.rb
|
710
790
|
- spec/unit/embed_spec.rb
|
711
791
|
- spec/unit/logger_spec.rb
|
712
|
-
- spec/unit/notification_shared.rb
|
713
792
|
- spec/unit/plugin_spec.rb
|
714
793
|
- spec/unit/push_spec.rb
|
715
794
|
- spec/unit/reflectable_spec.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Rpush
|
2
|
-
module Client
|
3
|
-
module ActiveModel
|
4
|
-
module Apns
|
5
|
-
class BinaryNotificationValidator < ::ActiveModel::Validator
|
6
|
-
MAX_BYTES = 2048
|
7
|
-
|
8
|
-
def validate(record)
|
9
|
-
return unless record.payload.bytesize > MAX_BYTES
|
10
|
-
record.errors[:base] << "APN notification cannot be larger than #{MAX_BYTES} bytes. Try condensing your alert and device attributes."
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|