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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b131a0f6ab709fb703d99fb398bf0707cb765d3
4
- data.tar.gz: 1ed7d53fa8624a105594a0e167cac9b2347204c2
3
+ metadata.gz: 0f51a8767ef2a55fb5d62cd8345456b742920ae6
4
+ data.tar.gz: b06f04544e21e672debfb2309291991fda740a64
5
5
  SHA512:
6
- metadata.gz: d2f92027e6f4ae9470f1b81d464a626447d869c6fa808be3073a64f660b6e03d2ae2bb4639e8894ede73dc9d43d6c6a006f3357f163603c1f919c8c6dd9ed7f0
7
- data.tar.gz: 0d710e4c527cf608767f0d070ff786ee6e5e7d247f69133673ac724cde79b74fe48c03d0b45fbc5e3f0a45a79a06228a1b9fb00ed2db57a9a7454edbd2582791
6
+ metadata.gz: 5dac9252cda39669fdd53027037314e3f66fc03193b4bab378ad90b42faa2933fd82e73d2d08d15aefa2dec770117841eda1879a411d8cb16d78816f731a4025
7
+ data.tar.gz: cd06596d02e731b162885b53d4734aea5becef4d5e17d468c4445eec912ea84c56770207a50bb2e499e1876090be53e78476f88db82c59b9fe8ff9f3909ee234
@@ -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) >= 0
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.length})" unless
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
@@ -1,3 +1,3 @@
1
1
  module J7W1
2
- VERSION = "0.0.27.1"
2
+ VERSION = "0.0.27.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: j7w1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27.1
4
+ version: 0.0.27.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - condor