Sha256: 05a7faba8997a403fc8118b257435fc1e313631dc1fab3fe8c6d45bf85641d8a

Contents?: true

Size: 445 Bytes

Versions: 12

Compression:

Stored size: 445 Bytes

Contents

require 'logger'

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

12 entries across 12 versions & 1 rubygems

Version Path
dry-validation-0.10.4 lib/dry/validation/deprecations.rb
dry-validation-0.10.3 lib/dry/validation/deprecations.rb
dry-validation-0.10.2 lib/dry/validation/deprecations.rb
dry-validation-0.10.1 lib/dry/validation/deprecations.rb
dry-validation-0.10.0 lib/dry/validation/deprecations.rb
dry-validation-0.9.5 lib/dry/validation/deprecations.rb
dry-validation-0.9.4 lib/dry/validation/deprecations.rb
dry-validation-0.9.3 lib/dry/validation/deprecations.rb
dry-validation-0.9.2 lib/dry/validation/deprecations.rb
dry-validation-0.9.1 lib/dry/validation/deprecations.rb
dry-validation-0.9.0 lib/dry/validation/deprecations.rb
dry-validation-0.8.0 lib/dry/validation/deprecations.rb