pdf_margins 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdf/margins/checker.rb +2 -1
- data/lib/pdf/margins/errors.rb +5 -0
- data/lib/pdf/margins/version.rb +1 -1
- data/test/checker_test.rb +6 -0
- data/test/test_helper.rb +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 627c8a5b2633419fa30dc4d9633ca4b5825f822b
|
4
|
+
data.tar.gz: 0489558643554e50cdbeaf5c18c78c0a62013e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 950b461d6e613d583da0e7ae629bc6c04d792fa440ef77e0469e50c2925a2ed061c1927e3852e995f07514f6166582dc443155ccdbcb2624005e45ccbc241141
|
7
|
+
data.tar.gz: 646cb27222b39c19529abdf79915afff2a8f875c73fbba2efcfac0b242e0889279813ec99c2152554f2954ea792f000a61ea5bc47ec94a63443600969bd2258a
|
data/lib/pdf/margins/checker.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'pdf/margins/issue'
|
2
|
+
require 'pdf/margins/errors'
|
2
3
|
require 'chunky_png'
|
3
4
|
require 'oily_png'
|
4
5
|
require 'tmpdir'
|
@@ -33,7 +34,7 @@ module PDF
|
|
33
34
|
begin
|
34
35
|
# This produces greyscale PNGs - we throw the colour away because we
|
35
36
|
# don't need it to check for margins.
|
36
|
-
system("mudraw -g -b 0 -r #{RESOLUTION} -o #{temp_dir_path}/%d.png #{file_path}") || raise
|
37
|
+
system("mudraw -g -b 0 -r #{RESOLUTION} -o #{temp_dir_path}/%d.png #{file_path}") || raise(PDF::Margins::MuDrawCommandError)
|
37
38
|
|
38
39
|
issues = []
|
39
40
|
|
data/lib/pdf/margins/version.rb
CHANGED
data/test/checker_test.rb
CHANGED
@@ -86,4 +86,10 @@ class CheckerTest < Test::Unit::TestCase
|
|
86
86
|
assert_equal [], checker.issues
|
87
87
|
end
|
88
88
|
|
89
|
+
test "shelling out to mudraw fails" do
|
90
|
+
checker = PDF::Margins::Checker.new(pdf_path('bottom-margin-only.pdf'), 15, 15, 15, 15)
|
91
|
+
checker.expects(:system).returns(false)
|
92
|
+
assert_raises(PDF::Margins::MuDrawCommandError) { checker.issues }
|
93
|
+
end
|
94
|
+
|
89
95
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf_margins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chunky_png
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mocha
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.14.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.14.0
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- tom@newspaperclub.com
|
@@ -74,6 +88,7 @@ extensions: []
|
|
74
88
|
extra_rdoc_files: []
|
75
89
|
files:
|
76
90
|
- lib/pdf/margins/checker.rb
|
91
|
+
- lib/pdf/margins/errors.rb
|
77
92
|
- lib/pdf/margins/issue.rb
|
78
93
|
- lib/pdf/margins/version.rb
|
79
94
|
- lib/pdf/margins.rb
|