From f4d808a1722dd0f850afd0ca706103625d0eeb31 Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Wed, 24 May 2017 11:04:54 -0500 Subject: [PATCH] wkhtmltopdf is not necessarily a file --- lib/wicked_pdf.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/wicked_pdf.rb b/lib/wicked_pdf.rb index aa607ecf..e1fb4f14 100644 --- a/lib/wicked_pdf.rb +++ b/lib/wicked_pdf.rb @@ -39,9 +39,9 @@ class WickedPdf def initialize(wkhtmltopdf_binary_path = nil) @exe_path = wkhtmltopdf_binary_path || find_wkhtmltopdf_binary_path raise "Location of #{EXE_NAME} unknown" if @exe_path.empty? - raise "Bad #{EXE_NAME}'s path: #{@exe_path}" unless File.exist?(@exe_path) - raise "#{EXE_NAME} is not executable" unless File.executable?(@exe_path) - + raise "The executable provided doesn't seem to be #{EXE_NAME}" unless `#{@exe_path} --version`.start_with?(EXE_NAME) + raise "#{EXE_NAME} isn't running correctly" unless $?.success? + retrieve_binary_version end