Skip to content

Commit

Permalink
Change from always executing which wkhtmltopdf to only executing it…
Browse files Browse the repository at this point in the history
… if the binary file's location is not explicitly stated in config.
  • Loading branch information
Alex Redington committed Dec 27, 2010
1 parent 89013da commit 8ee2d32
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/pdfkit/configuration.rb
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -15,6 +15,10 @@ def initialize
:encoding => "UTF-8"
}
end

def wkhtmltopdf
@wkhtmltopdf ||= `which wkhtmltopdf`.chomp
end
end

class << self
Expand Down

0 comments on commit 8ee2d32

Please sign in to comment.