j7w1 0.0.27.1 → 0.0.27.2
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.
- checksums.yaml +4 -4
- data/lib/j7w1/sns_push_client.rb +2 -2
- data/lib/j7w1/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f51a8767ef2a55fb5d62cd8345456b742920ae6
|
4
|
+
data.tar.gz: b06f04544e21e672debfb2309291991fda740a64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dac9252cda39669fdd53027037314e3f66fc03193b4bab378ad90b42faa2933fd82e73d2d08d15aefa2dec770117841eda1879a411d8cb16d78816f731a4025
|
7
|
+
data.tar.gz: cd06596d02e731b162885b53d4734aea5becef4d5e17d468c4445eec912ea84c56770207a50bb2e499e1876090be53e78476f88db82c59b9fe8ff9f3909ee234
|
data/lib/j7w1/sns_push_client.rb
CHANGED
@@ -162,11 +162,11 @@ module J7W1
|
|
162
162
|
payload = data.to_json
|
163
163
|
|
164
164
|
# Truncation is skipped when the payload is sufficiently lightweight.
|
165
|
-
return payload if (limit_break = payload.bytesize - APNS_MAX_PAYLOAD)
|
165
|
+
return payload if (limit_break = payload.bytesize - APNS_MAX_PAYLOAD) <= 0
|
166
166
|
|
167
167
|
# Raise error if shortening of the alert cannot make the payload sufficiently short.
|
168
168
|
size_to_reduce = limit_break + SHORTEN_REPLACEMENT_LENGTH
|
169
|
-
raise "Payload is too heavy (#{payload.
|
169
|
+
raise "Payload is too heavy (original size: #{payload.bytesize}, except message: (#{payload.bytesize - data[:alert].to_s.bytesize}))" unless
|
170
170
|
data[:alert] && data[:alert].bytesize > size_to_reduce
|
171
171
|
|
172
172
|
# Chopping the alert from its last -> first to avoid destroying the character's border
|
data/lib/j7w1/version.rb
CHANGED