-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wkhtmltopdf is not necessarily a file #653
base: master
Are you sure you want to change the base?
Conversation
lib/wicked_pdf.rb
Outdated
@@ -39,7 +39,6 @@ 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this executable check also raise in your case?
File.executable?('/bin/ls') # => true
File.executable?('/bin/ls -a') => false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and you're right, I will change the PR
5d236e0
to
f4d808a
Compare
What do you think about putting the original Something like this: unless EXE_PATH.include?('xvfb')
raise "Bad #{EXE_NAME}'s path: #{@exe_path}" unless File.exist?(@exe_path)
raise "#{EXE_NAME} is not executable" unless File.executable?(@exe_path)
end I worry that removing these |
What about introducing a WickedPdf.config = {
:wkhtmltopdf_command => 'xvfb-run -- wkhtmltopdf'
} Which would have no validations? I also think that the current This issue probably affects lots of users, since the official Ruby Docker image is based on Debian jessie and the Debian Example: xvfb-run -- wkhtmltopdf [options] see: https://sources.debian.net/src/wkhtmltopdf/0.12.3.2-3/debian/README.Debian/ |
@zorbash That sounds like a good compromise, though I am hesitant to rename the existing config option until it gets properly deprecated. There's also some confusion around the |
WKHTMLTOPDF is not necessarily a file: