Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change from always executing `which wkhtmltopdf` to only executing it…

… if the binary file's location is not explicitly stated in config.
  • Loading branch information...
commit 8ee2d3262f2348554014e1a0842ac0bfbb8bbd99 1 parent 89013da
@aredington aredington authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/pdfkit/configuration.rb
View
8 lib/pdfkit/configuration.rb
@@ -1,10 +1,10 @@
class PDFKit
class Configuration
- attr_accessor :meta_tag_prefix, :wkhtmltopdf, :default_options
+ attr_accessor :meta_tag_prefix, :default_options
+ attr_writer :wkhtmltopdf
def initialize
@meta_tag_prefix = 'pdfkit-'
- @wkhtmltopdf = `which wkhtmltopdf`.chomp
@default_options = {
:disable_smart_shrinking => true,
:page_size => 'Letter',
@@ -15,6 +15,10 @@ def initialize
:encoding => "UTF-8"
}
end
+
+ def wkhtmltopdf
+ @wkhtmltopdf ||= `which wkhtmltopdf`.chomp
+ end
end
class << self
Please sign in to comment.
Something went wrong with that request. Please try again.