dragonfly_pdf 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3e59a245f47b7c1e155fe0ec8acd70a8116e7e6
4
- data.tar.gz: c91655b09e67dec8b2b8e6c929383239248f0022
3
+ metadata.gz: bfa3a27cf223f3cd1915246bf5fcb2462e3b155c
4
+ data.tar.gz: 36e427b72e8078947c0c36b36b3e2aea56530e4d
5
5
  SHA512:
6
- metadata.gz: cd01b1b73d60661fc19f9f6953838631208f383b0fbd340d6bc37b7dbe33c217d99b8587574b034ebc44d9691386cfb059be5b2270c6102fa2499acf9a5274a7
7
- data.tar.gz: 0cee5d23bde1ee22c975d4288722030a00bc8d097b1e3e3957df078cbbefa8d4d2767b1c66b0a9bf5431dd0c98a6ac8a654f6deb671aaad8328e0e3a616102fd
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 = box_data.select { |d| d.first == 'MediaBox' }[0..-2]
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) }
@@ -1,3 +1,3 @@
1
1
  module DragonflyPdf
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
@@ -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
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-01-26 00:00:00.000000000 Z
11
+ date: 2016-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dragonfly