mercurius 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mercurius/apns/notification.rb +6 -5
- data/lib/mercurius/version.rb +1 -1
- data/spec/lib/apns_notification_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54e5187f1735963b3bb20d693ac7727b615eebf
|
4
|
+
data.tar.gz: 1ea72290aa7391f2514078ceb940779180b25b2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1353ad68cbbebaf2fd1465a7def0ae3398f15e333f9b32acf8c875294129f035ba1fcdfe4c1c96c5572f6d2cfe112d3fb581254edfc7cc7fa60a3a2295afb759
|
7
|
+
data.tar.gz: fe321d6a12ab874e635dcd8d7384fd5d353836cb07abb2e2fa54a48a0aa3675152152d63f9110c883f64486dc4dbede7c5213683673113925e2f3334ad43e85e
|
@@ -4,7 +4,7 @@ module APNS
|
|
4
4
|
|
5
5
|
MAX_PAYLOAD_BYTES = 2048
|
6
6
|
|
7
|
-
attr_accessor :alert, :badge, :sound, :other
|
7
|
+
attr_accessor :alert, :badge, :sound, :other, :content_available
|
8
8
|
attr_reader :attributes
|
9
9
|
|
10
10
|
def initialize(attributes = {})
|
@@ -14,10 +14,11 @@ module APNS
|
|
14
14
|
|
15
15
|
def payload
|
16
16
|
{
|
17
|
-
alert
|
18
|
-
badge
|
19
|
-
sound
|
20
|
-
other
|
17
|
+
'alert' => alert,
|
18
|
+
'badge' => badge,
|
19
|
+
'sound' => sound,
|
20
|
+
'other' => other,
|
21
|
+
'content-available' => content_available,
|
21
22
|
}.compact
|
22
23
|
end
|
23
24
|
|
data/lib/mercurius/version.rb
CHANGED
@@ -2,14 +2,14 @@ describe APNS::Notification do
|
|
2
2
|
|
3
3
|
describe '#==' do
|
4
4
|
it 'doesnt care about object equality' do
|
5
|
-
a = APNS::Notification.new(alert: '1', badge: 1, other: { a: :b }, sound: 'default')
|
6
|
-
b = APNS::Notification.new(alert: '1', badge: 1, other: { a: :b }, sound: 'default')
|
5
|
+
a = APNS::Notification.new(alert: '1', badge: 1, other: { a: :b }, sound: 'default', content_available: 0)
|
6
|
+
b = APNS::Notification.new(alert: '1', badge: 1, other: { a: :b }, sound: 'default', content_available: 0)
|
7
7
|
expect(a == b).to eq true
|
8
8
|
end
|
9
9
|
|
10
|
-
%w(alert badge other sound).each do |attr|
|
10
|
+
%w(alert badge other sound content_available).each do |attr|
|
11
11
|
it "must match #{attr} to be considered equal" do
|
12
|
-
attributes = { alert: '1', badge: 1, other: { a: :b }, sound: 'default' }
|
12
|
+
attributes = { alert: '1', badge: 1, other: { a: :b }, sound: 'default', content_available: 0 }
|
13
13
|
a = APNS::Notification.new(attributes)
|
14
14
|
b = APNS::Notification.new(attributes.merge(attr => SecureRandom.hex))
|
15
15
|
expect(a == b).to eq false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mercurius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Beck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|