lib/pdfkit/pdfkit.rb in pdfkit-0.4.0 vs lib/pdfkit/pdfkit.rb in pdfkit-0.4.1

- old
+ new

@@ -19,25 +19,13 @@ def initialize(url_file_or_html, options = {}) @source = Source.new(url_file_or_html) @stylesheets = [] - - default_options = { - :disable_smart_shrinking => true, - :page_size => 'Letter', - :margin_top => '0.75in', - :margin_right => '0.75in', - :margin_bottom => '0.75in', - :margin_left => '0.75in' - } - @options = options.dup - unless source.url? - @options.merge! find_options_in_meta(url_file_or_html) - end - @options = normalize_options(default_options.merge(@options)) + @options = normalize_options(PDFKit.configuration.default_options.merge(options)) + @options.merge! find_options_in_meta(url_file_or_html) unless source.url? raise NoExecutableError.new unless File.exists?(PDFKit.configuration.wkhtmltopdf) end def command @@ -128,10 +116,10 @@ def normalize_value(value) case value when TrueClass nil else - value + value.to_s end end end \ No newline at end of file