Sha256: ef1fb3c613cc360660e8dc5388d29fa81b6d7e4cb00a95bb91e8785d75faec86

Contents?: true

Size: 1.36 KB

Versions: 12

Compression:

Stored size: 1.36 KB

Contents

module VCR
  # @deprecated Use #configure instead.
  # @see #configure
  def config
    warn "WARNING: `VCR.config` is deprecated.  Use VCR.configure instead."
    configure { |c| yield c }
  end

  # @private
  def self.const_missing(const)
    return super unless const == :Config
    warn "WARNING: `VCR::Config` is deprecated.  Use VCR.configuration instead."
    configuration
  end

  # @private
  def Cassette.const_missing(const)
    return super unless const == :MissingERBVariableError
    warn "WARNING: `VCR::Cassette::MissingERBVariableError` is deprecated.  Use `VCR::Errors::MissingERBVariableError` instead."
    Errors::MissingERBVariableError
  end

  class Configuration
    # @deprecated Use #hook_into instead.
    # @see #hook_into
    def stub_with(*adapters)
      warn "WARNING: `VCR.config { |c| c.stub_with ... }` is deprecated. Use `VCR.configure { |c| c.hook_into ... }` instead."
      hook_into(*adapters)
    end
  end

  # @private
  module Deprecations
    module Middleware
      # @private
      module Faraday
        def initialize(*args)
          if block_given?
            Kernel.warn "WARNING: Passing a block to `VCR::Middleware::Faraday` is deprecated. \n" +
                        "As of VCR 2.0, you need to wrap faraday requests in VCR.use_cassette, just like with any other library hook."
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
vcr-2.3.0 lib/vcr/deprecations.rb
vcr-2.2.5 lib/vcr/deprecations.rb
vcr-2.2.4 lib/vcr/deprecations.rb
vcr-2.2.3 lib/vcr/deprecations.rb
vcr-2.2.2 lib/vcr/deprecations.rb
vcr-2.2.1 lib/vcr/deprecations.rb
vcr-2.2.0 lib/vcr/deprecations.rb
vcr-2.1.1 lib/vcr/deprecations.rb
vcr-2.1.0 lib/vcr/deprecations.rb
vcr-2.0.1 lib/vcr/deprecations.rb
vcr-2.0.0 lib/vcr/deprecations.rb
vcr-2.0.0.rc2 lib/vcr/deprecations.rb