Sha256: d2766b534f115d9e7ebd42b738fd7da0d7e415b48ba9c194e231c666c2cb4897

Contents?: true

Size: 472 Bytes

Versions: 14

Compression:

Stored size: 472 Bytes

Contents

require 'logger'
require 'dry/configurable'

module Dry
  module Validation
    module Deprecations
      extend Dry::Configurable

      setting :logger, Logger.new($stdout)

      def self.format(msg, caller)
        "#{msg} [#{caller[1].split(':')[0..1].join(' line ')}]"
      end

      def logger
        @logger ||= Deprecations.config.logger
      end

      def warn(msg)
        logger.warn(Deprecations.format(msg, ::Kernel.caller))
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dry-validation-0.13.3 lib/dry/validation/deprecations.rb
dry-validation-0.13.2 lib/dry/validation/deprecations.rb
dry-validation-0.13.1 lib/dry/validation/deprecations.rb
dry-validation-0.11.2 lib/dry/validation/deprecations.rb
dry-validation-0.12.3 lib/dry/validation/deprecations.rb
dry-validation-0.13.0 lib/dry/validation/deprecations.rb
dry-validation-0.12.2 lib/dry/validation/deprecations.rb
dry-validation-0.12.1 lib/dry/validation/deprecations.rb
dry-validation-0.12.0 lib/dry/validation/deprecations.rb
dry-validation-0.11.1 lib/dry/validation/deprecations.rb
dry-validation-0.11.0 lib/dry/validation/deprecations.rb
dry-validation-0.10.7 lib/dry/validation/deprecations.rb
dry-validation-0.10.6 lib/dry/validation/deprecations.rb
dry-validation-0.10.5 lib/dry/validation/deprecations.rb