diff --git a/lib/wicked_pdf.rb b/lib/wicked_pdf.rb index 38d477a5..ab34d959 100644 --- a/lib/wicked_pdf.rb +++ b/lib/wicked_pdf.rb @@ -20,10 +20,18 @@ class WickedPdf DEFAULT_BINARY_VERSION = Gem::Version.new('0.9.9') @@config = {} - cattr_accessor :config + cattr_accessor :config, :silence_deprecations include Progress + def self.config=(config) + unless @@silence_deprecations + ::Kernel.warn "WickedPdf.config= is deprecated and will be removed in future versions. Use WickedPdf.configure instead." + end + + @@config = config + end + def self.configure config = OpenStruct.new(@@config) yield config diff --git a/test/test_helper.rb b/test/test_helper.rb index 15990f93..74257052 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -11,6 +11,7 @@ require 'wicked_pdf' Rails.backtrace_cleaner.remove_silencers! +WickedPdf.silence_deprecations = true if (assets_dir = Rails.root.join('app/assets')) && File.directory?(assets_dir) # Copy CSS file