pdf_matcher 1.0.1 → 2.0.0

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
  SHA256:
3
- metadata.gz: c72b513695745c25fe76222180e4696e1f193792bcbe5b414ac7566ca6df67e5
4
- data.tar.gz: 7e3733f4f0a62233268d78e539c3bcb122309863aa4d344109668b85f3acdfb5
3
+ metadata.gz: a11245a6de1b19f44ca33ac182e325657ac5662696958ff637a63c5a7a0ee50c
4
+ data.tar.gz: 3ce202dff0306a6fb81f16f83efe2a2fdf64cac597a815eb6713f656e4e1ef99
5
5
  SHA512:
6
- metadata.gz: 19e1830cf927f2674a712036bf180865e2d3b12a1860bf8ee485d18482a21be4be250777dbe45ca349e735b0658317474dbeec0d63f762c12eaadee58bd8b4de
7
- data.tar.gz: 314cdaf0e906a8702a03c9dea1c548318b8415adca85904539e46084260b54524b087f6c3e37ba39ee6764cadf8a76f89cd1cf45bf52a39e0a0cf3274e47c24d
6
+ metadata.gz: 2ef1a7e18d03c6eb4a3b57777f850866393e0a9be7176e6ba50a33becc1cec9ec077caa2cac5dbc85a18735726984c94a774dd05f6e3ec0d0c72c20a70e89359
7
+ data.tar.gz: 761a3295ad8795988e97c0ca7dc019b17814f851401dcc0e247e06a588d3d78a1f5c1b6664f8e6eb5ab23fd9812aa1f2a962db839b145dbed368eee88ec5f298
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.0.0
2
+
3
+ ### Breaking Changes
4
+
5
+ - Delete (not keep) the difference PDF when the PDFs are matched [44b05f8](https://github.com/hidakatsuya/pdf_matcher/commit/44b05f8c0df8d2429e3b6c50e2fbb02ed87ee139)
6
+
1
7
  ## 1.0.1
2
8
 
3
9
  ### Bug Fixes
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
- - [test-unit-pdf_matcher](https://github.com/hidakatsuya/test-unit-pdf_matcher)
72
+ Try [pdf_matcher-testing gem](https://github.com/hidakatsuya/pdf_matcher-testing).
73
73
 
74
74
  ## Contributing
75
75
 
@@ -14,7 +14,18 @@ module PdfMatcher
14
14
  end
15
15
 
16
16
  def match
17
- @result ||= MatchResult.new(match_pdfs, pdf1, pdf2, output_diff_path)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PdfMatcher
4
- VERSION = '1.0.1'
4
+ VERSION = '2.0.0'
5
5
  end
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: 1.0.1
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-07 00:00:00.000000000 Z
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