Sha256: eda07292e1ff8f412a2ba0a84a64eb1f81762318380f47a9d45a2fd49c0cb8f5

Contents?: true

Size: 475 Bytes

Versions: 6

Compression:

Stored size: 475 Bytes

Contents

module DatabaseCleaner
  def deprecate message
    method = caller.first[/\d+:in `(.*)'$/, 1].to_sym
    @@deprecator ||= Deprecator.new
    @@deprecator.deprecate method, message
  end
  module_function :deprecate

  class Deprecator
    def initialize
      @methods_already_warned = {}
    end

    def deprecate method, message
      return if @methods_already_warned.key?(method)
      $stderr.puts message
      @methods_already_warned[method] = true
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/deprecation.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/deprecation.rb
database_cleaner-core-2.0.1 lib/database_cleaner/deprecation.rb
database_cleaner-core-2.0.0 lib/database_cleaner/deprecation.rb
database_cleaner-core-2.0.0.beta2 lib/database_cleaner/deprecation.rb
database_cleaner-core-2.0.0.beta lib/database_cleaner/deprecation.rb