dragonfly_pdf 0.2.4 → 0.2.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfa3a27cf223f3cd1915246bf5fcb2462e3b155c
|
4
|
+
data.tar.gz: 36e427b72e8078947c0c36b36b3e2aea56530e4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf0f7d7a844580c4db53c921acc8d9d21b93de3cd2a68358384c1e80ac2ac09279d48b666ba9817146caca1cee981e53c564a783af9d5f053c18c88e7c9f35e0
|
7
|
+
data.tar.gz: 8a4dce72ccfe3b7670c24f1dca2cadf0db1e76cb2f19a7ba2be85bd08f1f2c092cc158cd5ad73e8adcd4498a6456be91276308591dee8531a7b80434394d83f3
|
@@ -11,9 +11,11 @@ module DragonflyPdf
|
|
11
11
|
rotate_data += item.scan(/\/Rotate\s(\d+?)\s/)
|
12
12
|
end
|
13
13
|
|
14
|
+
media_box = box_data.select{ |d| d.first =~ /mediabox/i }
|
15
|
+
desired_box = box_data.select{ |d| d.first =~ /#{box_type}/i }
|
16
|
+
|
14
17
|
# drop last value, since that comes from data about all pages
|
15
|
-
media_box =
|
16
|
-
desired_box = box_data.select { |d| d.first == box_type }
|
18
|
+
media_box = media_box[0..-2] if media_box.length > 1
|
17
19
|
|
18
20
|
page_dimensions = (desired_box.length > 0 ? desired_box : media_box).map do |dim|
|
19
21
|
i = dim[1..-1].map(&:to_f).map{ |d| pt2mm(d) }
|
@@ -18,12 +18,14 @@ module DragonflyPdf
|
|
18
18
|
describe '#page_numbers' do
|
19
19
|
it 'returns one-dimensional array' do
|
20
20
|
analyser.call(sample_pages)[:page_numbers].must_equal (1..10).to_a
|
21
|
+
analyser.call(sample_pages_with_bleed)[:page_numbers].must_equal [1]
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
25
|
describe '#page_count' do
|
25
26
|
it 'returns correct page count' do
|
26
27
|
analyser.call(sample_pages)[:page_count].must_equal 10
|
28
|
+
analyser.call(sample_pages_with_bleed)[:page_count].must_equal 1
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragonfly_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dragonfly
|