rapns_rails_2 3.5.0 → 3.5.1
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.
- data/CHANGELOG.md +3 -0
- data/lib/generators/templates/add_gcm.rb +2 -2
- data/lib/generators/templates/create_rapns_feedback.rb +1 -1
- data/lib/generators/templates/create_rapns_notifications.rb +1 -1
- data/lib/rapns/apns/device_token_format_validator.rb +1 -1
- data/lib/rapns/version.rb +1 -1
- data/spec/unit/apns/notification_spec.rb +3 -3
- data/spec/unit/daemon/feeder_spec.rb +1 -1
- data/spec/unit/daemon/store/active_record_spec.rb +1 -1
- metadata +5 -5
data/CHANGELOG.md
CHANGED
@@ -19,7 +19,7 @@ class AddGcm < ActiveRecord::Migration
|
|
19
19
|
|
20
20
|
change_column :rapns_notifications, :type, :string, :null => false
|
21
21
|
change_column :rapns_apps, :type, :string, :null => false
|
22
|
-
change_column :rapns_notifications, :device_token, :string, { :null => true, :limit =>
|
22
|
+
change_column :rapns_notifications, :device_token, :string, { :null => true, :limit => 256 }
|
23
23
|
change_column :rapns_notifications, :expiry, :integer, { :null => true, :default => 1.day.to_i }
|
24
24
|
change_column :rapns_apps, :environment, :string, :null => true
|
25
25
|
change_column :rapns_apps, :certificate, :text, :null => true, :default => nil
|
@@ -60,7 +60,7 @@ class AddGcm < ActiveRecord::Migration
|
|
60
60
|
remove_column :rapns_notifications, :type
|
61
61
|
remove_column :rapns_apps, :type
|
62
62
|
|
63
|
-
change_column :rapns_notifications, :device_token, :string, { :null => false, :limit =>
|
63
|
+
change_column :rapns_notifications, :device_token, :string, { :null => false, :limit => 256 }
|
64
64
|
change_column :rapns_notifications, :expiry, :integer, { :null => false, :default => 1.day.to_i }
|
65
65
|
change_column :rapns_apps, :environment, :string, :null => false
|
66
66
|
change_column :rapns_apps, :certificate, :text, :null => false
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class CreateRapnsFeedback < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
create_table :rapns_feedback do |t|
|
4
|
-
t.string :device_token, :null => false, :limit =>
|
4
|
+
t.string :device_token, :null => false, :limit => 256
|
5
5
|
t.timestamp :failed_at, :null => false
|
6
6
|
t.timestamps
|
7
7
|
end
|
@@ -2,7 +2,7 @@ class CreateRapnsNotifications < ActiveRecord::Migration
|
|
2
2
|
def self.up
|
3
3
|
create_table :rapns_notifications do |t|
|
4
4
|
t.integer :badge, :null => true
|
5
|
-
t.string :device_token, :null => false, :limit =>
|
5
|
+
t.string :device_token, :null => false, :limit => 256
|
6
6
|
t.string :sound, :null => true, :default => "1.aiff"
|
7
7
|
t.string :alert, :null => true
|
8
8
|
t.text :attributes_for_device, :null => true
|
data/lib/rapns/version.rb
CHANGED
@@ -18,7 +18,7 @@ describe Rapns::Apns::Notification do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should validate the length of the binary conversion of the notification" do
|
21
|
-
notification.device_token = "a" *
|
21
|
+
notification.device_token = "a" * 256
|
22
22
|
notification.alert = "way too long!" * 100
|
23
23
|
notification.valid?.should be_false
|
24
24
|
notification.errors[:base].include?("APN notification cannot be larger than 256 bytes. Try condensing your alert and device attributes.").should be_true
|
@@ -148,7 +148,7 @@ end
|
|
148
148
|
describe Rapns::Apns::Notification, "to_binary" do
|
149
149
|
it "should correctly convert the notification to binary" do
|
150
150
|
notification = Rapns::Apns::Notification.new
|
151
|
-
notification.device_token = "a" *
|
151
|
+
notification.device_token = "a" * 256
|
152
152
|
notification.sound = "1.aiff"
|
153
153
|
notification.badge = 3
|
154
154
|
notification.alert = "Don't panic Mr Mainwaring, don't panic!"
|
@@ -179,7 +179,7 @@ end
|
|
179
179
|
describe Rapns::Apns::Notification, "bug #35" do
|
180
180
|
it "should limit payload size to 256 bytes but not the entire packet" do
|
181
181
|
notification = Rapns::Apns::Notification.new do |n|
|
182
|
-
n.device_token = "a" *
|
182
|
+
n.device_token = "a" * 256
|
183
183
|
n.alert = "a" * 210
|
184
184
|
n.app = Rapns::Apns::App.create!(:name => 'my_app', :environment => 'development', :certificate => TEST_CERT)
|
185
185
|
end
|
@@ -7,7 +7,7 @@ describe Rapns::Daemon::Feeder do
|
|
7
7
|
:push => false,
|
8
8
|
:wakeup => nil) }
|
9
9
|
let!(:app) { Rapns::Apns::App.create!(:name => 'my_app', :environment => 'development', :certificate => TEST_CERT) }
|
10
|
-
let(:notification) { Rapns::Apns::Notification.create!(:device_token => "a" *
|
10
|
+
let(:notification) { Rapns::Apns::Notification.create!(:device_token => "a" * 256, :app => app) }
|
11
11
|
let(:logger) { double }
|
12
12
|
let(:interruptible_sleep) { double(:sleep => nil, :interrupt_sleep => nil) }
|
13
13
|
|
@@ -3,7 +3,7 @@ require 'rapns/daemon/store/active_record'
|
|
3
3
|
|
4
4
|
describe Rapns::Daemon::Store::ActiveRecord do
|
5
5
|
let(:app) { Rapns::Apns::App.create!(:name => 'my_app', :environment => 'development', :certificate => TEST_CERT) }
|
6
|
-
let(:notification) { Rapns::Apns::Notification.create!(:device_token => "a" *
|
6
|
+
let(:notification) { Rapns::Apns::Notification.create!(:device_token => "a" * 256, :app => app) }
|
7
7
|
let(:store) { Rapns::Daemon::Store::ActiveRecord.new }
|
8
8
|
let(:now) { Time.now.utc }
|
9
9
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapns_rails_2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 3.5.
|
9
|
+
- 1
|
10
|
+
version: 3.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ian Leitch
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
19
|
+
date: 2017-05-12 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: multi_json
|
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
197
|
requirements: []
|
198
198
|
|
199
199
|
rubyforge_project:
|
200
|
-
rubygems_version: 1.8.
|
200
|
+
rubygems_version: 1.8.10
|
201
201
|
signing_key:
|
202
202
|
specification_version: 3
|
203
203
|
summary: Professional grade APNs and GCM for Ruby
|