Class: PdfMatcher::DiffPdf
- Inherits:
-
Object
- Object
- PdfMatcher::DiffPdf
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/pdf_matcher/diff_pdf.rb
Defined Under Namespace
Classes: CommandNotAvailable, UnknownDiffPdfExitCode
Instance Method Summary collapse
- #exec(pdf1_path, pdf2_path, output_diff: nil, options: nil) ⇒ Object
-
#initialize ⇒ DiffPdf
constructor
A new instance of DiffPdf.
Constructor Details
#initialize ⇒ DiffPdf
Returns a new instance of DiffPdf.
29 30 31 |
# File 'lib/pdf_matcher/diff_pdf.rb', line 29 def initialize verify_available! end |
Instance Method Details
#exec(pdf1_path, pdf2_path, output_diff: nil, options: nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/pdf_matcher/diff_pdf.rb', line 33 def exec(pdf1_path, pdf2_path, output_diff: nil, options: nil) `diff-pdf #{(output_diff, ).join(' ')} #{pdf1_path} #{pdf2_path} > /dev/null 2>&1` case $?.exitstatus when 0 true when 1 false else raise UnknownDiffPdfExitCode, $?.exitstatus end end |