lib/wisepdf/configuration.rb in wisepdf-1.1.3 vs lib/wisepdf/configuration.rb in wisepdf-1.2.0

- old
+ new

@@ -1,32 +1,33 @@ require 'singleton' module Wisepdf class Configuration include Singleton - cattr_accessor :options - cattr_accessor :wkhtmltopdf class << self + attr_accessor :options + attr_accessor :wkhtmltopdf + def wkhtmltopdf - return @@wkhtmltopdf if @@wkhtmltopdf.present? + return @wkhtmltopdf if @wkhtmltopdf.present? - if @@wkhtmltopdf.nil? && !self.windows? - @@wkhtmltopdf = (defined?(Bundler) ? `bundle exec which wkhtmltopdf` : `which wkhtmltopdf`).chomp + if @wkhtmltopdf.nil? && !self.windows? + @wkhtmltopdf = (defined?(Bundler) ? `bundle exec which wkhtmltopdf` : `which wkhtmltopdf`).chomp end - return @@wkhtmltopdf + return @wkhtmltopdf end def configure yield self end def reset! - @@options = { - :layout => "pdf.html", + @options = { + :encoding => "UTF-8", :use_xserver => false } - @@wkhtmltopdf = nil + @wkhtmltopdf = nil end def development? (defined?(::Rails) && ::Rails.env == 'development') || (defined?(RAILS_ENV) && RAILS_ENV == 'development') \ No newline at end of file