config: Allow Operating System portability

try to use system version of wkhtmltopddf if installed
before trying to use the linux build in project bin, which may crash
This commit is contained in:
Matt Farnsworth 2015-10-21 15:55:58 +03:00
parent 53feab6a8c
commit 647d68b053

View file

@ -1,5 +1,9 @@
PDFKit.configure do |config|
config.wkhtmltopdf = "#{Rails.root}/vendor/bin/wkhtmltopdf"
installed = %x(which wkhtmltopdf).chomp
if installed == "" then
installed = "#{Rails.root}/vendor/bin/wkhtmltopdf"
end
config.wkhtmltopdf = installed
config.default_options = {
page_size: 'A4',
quiet: true