pdf_matcher 1.0.1 → 2.0.0
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 +6 -0
- data/README.md +2 -2
- data/lib/pdf_matcher/matcher.rb +12 -1
- data/lib/pdf_matcher/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: a11245a6de1b19f44ca33ac182e325657ac5662696958ff637a63c5a7a0ee50c
|
4
|
+
data.tar.gz: 3ce202dff0306a6fb81f16f83efe2a2fdf64cac597a815eb6713f656e4e1ef99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef1a7e18d03c6eb4a3b57777f850866393e0a9be7176e6ba50a33becc1cec9ec077caa2cac5dbc85a18735726984c94a774dd05f6e3ec0d0c72c20a70e89359
|
7
|
+
data.tar.gz: 761a3295ad8795988e97c0ca7dc019b17814f851401dcc0e247e06a588d3d78a1f5c1b6664f8e6eb5ab23fd9812aa1f2a962db839b145dbed368eee88ec5f298
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -60,7 +60,7 @@ result.pdf2_path #=> Pathname or nil
|
|
60
60
|
result.pdf1_data #=> "%PDF-..."
|
61
61
|
result.pdf2_data #=> "%PDF-..."
|
62
62
|
|
63
|
-
# Returns nil if the output_diff parameter is nil.
|
63
|
+
# Returns nil if the output_diff parameter is nil or the PDFs are matched.
|
64
64
|
result.diff_pdf_path #=> Pathname or nil
|
65
65
|
result.diff_pdf_data #=> "%PDF-..." or nil
|
66
66
|
|
@@ -69,7 +69,7 @@ PdfMatcher.config.diff_pdf_opts = ['--dpi=300']
|
|
69
69
|
|
70
70
|
## Use in Testing Frameworks
|
71
71
|
|
72
|
-
|
72
|
+
Try [pdf_matcher-testing gem](https://github.com/hidakatsuya/pdf_matcher-testing).
|
73
73
|
|
74
74
|
## Contributing
|
75
75
|
|
data/lib/pdf_matcher/matcher.rb
CHANGED
@@ -14,7 +14,18 @@ module PdfMatcher
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def match
|
17
|
-
@result ||=
|
17
|
+
@result ||= begin
|
18
|
+
matched = match_pdfs
|
19
|
+
|
20
|
+
if matched
|
21
|
+
# [NOTE] The diff-pdf command will generate a diff PDF file
|
22
|
+
# regardless of the result if the `--output_diff` option is given.
|
23
|
+
output_diff_path.unlink if output_diff_path&.exist?
|
24
|
+
MatchResult.new(matched, pdf1, pdf2, nil)
|
25
|
+
else
|
26
|
+
MatchResult.new(matched, pdf1, pdf2, output_diff_path)
|
27
|
+
end
|
28
|
+
end
|
18
29
|
end
|
19
30
|
|
20
31
|
private
|
data/lib/pdf_matcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf_matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katsuya Hidaka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: PdfMatcher is a gem to compare two PDFs and output the differences using
|
14
14
|
diff-pdf
|