combine_pdf 1.0.14 → 1.0.15
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/CHANGELOG.md +4 -0
- data/lib/combine_pdf/pdf_protected.rb +35 -8
- data/lib/combine_pdf/pdf_public.rb +2 -2
- data/lib/combine_pdf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23a07449258879f448dc9296b367ff0c9413a1ea2d40da8cbd0e2e9ba3830c61
|
4
|
+
data.tar.gz: 9624aab26ab067ba3e49ea0ec71f2f7ba22f0555e5e4e9784d787371364d4d04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aedfb6afebad0c9d7ff4f47141ab0f7f1352829358ee4b888815e525212ba7f853b73e353fb073df03a705ae7c131d8300c4acd5c1c30287e8f90cd68e07e920
|
7
|
+
data.tar.gz: e24bc6be0be1974711dd586d4a30cf94617e0c37a483613104558800ab5e8d04f32073bd09a0813cb386bb7c297164bfdb73a3fc0904b811c86b3afc7670b6b7
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
***
|
4
4
|
|
5
|
+
#### Change log v.1.0.15
|
6
|
+
|
7
|
+
**Fix**: An attempt to fix JRuby compatibility concerns (issue #127).
|
8
|
+
|
5
9
|
#### Change log v.1.0.14
|
6
10
|
|
7
11
|
**Fix**: Fixed an issue related to PDF XRef table data, where a malformed EOL marker would cause the parser to fail. Credit to @dangerous (David Rainsford) for exposing this issue in a comment to issue #140.
|
@@ -232,15 +232,42 @@ module CombinePDF
|
|
232
232
|
# @private
|
233
233
|
# this method reviews a Hash and updates it by merging Hash data,
|
234
234
|
# preffering the new over the old.
|
235
|
-
def self.hash_merge_new_no_page(_key, old_data, new_data)
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
235
|
+
# def self.hash_merge_new_no_page(_key = nil, old_data = nil, new_data = nil)
|
236
|
+
# return old_data unless new_data
|
237
|
+
# return new_data unless old_data
|
238
|
+
# if old_data.is_a?(Hash) && new_data.is_a?(Hash)
|
239
|
+
# return old_data if (old_data[:Type] == :Page)
|
240
|
+
# old_data.merge(new_data, &(@hash_merge_new_no_page_proc ||= method(:hash_merge_new_no_page)))
|
241
|
+
# elsif old_data.is_a? Array
|
242
|
+
# return old_data + new_data if new_data.is_a?(Array)
|
243
|
+
# return old_data.dup << new_data
|
244
|
+
# elsif new_data.is_a? Array
|
245
|
+
# new_data + [old_data]
|
246
|
+
# else
|
247
|
+
# new_data
|
248
|
+
# end
|
249
|
+
# end
|
250
|
+
|
251
|
+
# @private
|
252
|
+
# JRuby Alternative this method reviews a Hash and updates it by merging Hash data,
|
253
|
+
# preffering the new over the old.
|
254
|
+
HASH_MERGE_NEW_NO_PAGE = Proc.new do |_key = nil, old_data = nil, new_data = nil|
|
255
|
+
if !new_data
|
256
|
+
old_data
|
257
|
+
elsif !old_data
|
258
|
+
new_data
|
259
|
+
elsif old_data.is_a?(Hash) && new_data.is_a?(Hash)
|
260
|
+
if (old_data[:Type] == :Page)
|
261
|
+
old_data
|
262
|
+
else
|
263
|
+
old_data.merge(new_data, &HASH_MERGE_NEW_NO_PAGE)
|
264
|
+
end
|
241
265
|
elsif old_data.is_a? Array
|
242
|
-
|
243
|
-
|
266
|
+
if new_data.is_a?(Array)
|
267
|
+
old_data + new_data
|
268
|
+
else
|
269
|
+
old_data.dup << new_data
|
270
|
+
end
|
244
271
|
elsif new_data.is_a? Array
|
245
272
|
new_data + [old_data]
|
246
273
|
else
|
@@ -306,10 +306,10 @@ module CombinePDF
|
|
306
306
|
if data.is_a? PDF
|
307
307
|
@version = [@version, data.version].max
|
308
308
|
pages_to_add = data.pages
|
309
|
-
actual_value(@names ||= {}.dup).update data.names, &
|
309
|
+
actual_value(@names ||= {}.dup).update data.names, &HASH_MERGE_NEW_NO_PAGE
|
310
310
|
merge_outlines((@outlines ||= {}.dup), actual_value(data.outlines), location) unless actual_value(data.outlines).empty?
|
311
311
|
if actual_value(@forms_data)
|
312
|
-
actual_value(@forms_data).update actual_value(data.forms_data), &
|
312
|
+
actual_value(@forms_data).update actual_value(data.forms_data), &HASH_MERGE_NEW_NO_PAGE if data.forms_data
|
313
313
|
else
|
314
314
|
@forms_data = data.forms_data
|
315
315
|
end
|
data/lib/combine_pdf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: combine_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-rc4
|