From 9378d81f395dc01812200d9d6b0562fed02b4839 Mon Sep 17 00:00:00 2001 From: Micah Geisel Date: Mon, 23 Dec 2019 00:12:01 -0800 Subject: [PATCH] only log new deprecations once. --- lib/database_cleaner/configuration.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/database_cleaner/configuration.rb b/lib/database_cleaner/configuration.rb index f9e47e9..6e35983 100644 --- a/lib/database_cleaner/configuration.rb +++ b/lib/database_cleaner/configuration.rb @@ -55,23 +55,23 @@ module DatabaseCleaner attr_accessor :cleaners def app_root - $stderr.puts "Calling `DatabaseCleaner.app_root` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner::ActiveRecord.config_file_location`, instead." + DatabaseCleaner.deprecate "Calling `DatabaseCleaner.app_root` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner::ActiveRecord.config_file_location`, instead." @app_root ||= Dir.pwd end def app_root= value - $stderr.puts "Calling `DatabaseCleaner.app_root=` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner::ActiveRecord.config_file_location=`, instead." + DatabaseCleaner.deprecate "Calling `DatabaseCleaner.app_root=` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner::ActiveRecord.config_file_location=`, instead." @app_root = value end def logger - $stderr.puts "Calling `DatabaseCleaner.logger` is deprecated, and will be removed in database_cleaner 2.0 with no replacement." + DatabaseCleaner.deprecate "Calling `DatabaseCleaner.logger` is deprecated, and will be removed in database_cleaner 2.0 with no replacement." @logger ||= Logger.new(STDOUT).tap { |l| l.level = Logger::ERROR } end def logger= value - $stderr.puts "Calling `DatabaseCleaner.logger=` is deprecated, and will be removed in database_cleaner 2.0 with no replacement." - @logger= value + DatabaseCleaner.deprecate "Calling `DatabaseCleaner.logger=` is deprecated, and will be removed in database_cleaner 2.0 with no replacement." + @logger = value end def start