Sha256: 7785cad5baa3f952b3371b8b54eff8a3b98c99de0c07c01adf2e6cd48b47d45f

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

module VCR
  class Cassette
    def allow_real_http_requests_to?(uri)
      warn "WARNING: VCR::Cassette#allow_real_http_requests_to? is deprecated and should no longer be used."
      VCR::Config.uri_should_be_ignored?(uri.to_s)
    end

    private

      def deprecate_old_cassette_options(options)
        message = "VCR's :allow_real_http cassette option is deprecated.  Instead, use the ignore_localhost configuration option."
        if options[:allow_real_http] == :localhost
          @original_ignored_hosts = VCR::Config.ignored_hosts.dup
          VCR::Config.ignored_hosts.clear
          VCR::Config.ignore_hosts *VCR::LOCALHOST_ALIASES
          Kernel.warn "WARNING: #{message}"
        elsif options[:allow_real_http]
          raise ArgumentError.new(message)
        end
      end

      def restore_ignore_localhost_for_deprecation
        if defined?(@original_ignored_hosts)
          VCR::Config.ignored_hosts.clear
          VCR::Config.ignore_hosts *@original_ignored_hosts
        end
      end
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vcr-1.11.1 lib/vcr/deprecations/cassette.rb
vcr-1.10.3 lib/vcr/deprecations/cassette.rb
vcr-1.10.2 lib/vcr/deprecations/cassette.rb
vcr-1.10.0 lib/vcr/deprecations/cassette.rb
vcr-1.9.0 lib/vcr/deprecations/cassette.rb
vcr-1.8.0 lib/vcr/deprecations/cassette.rb
vcr-1.7.2 lib/vcr/deprecations/cassette.rb
vcr-1.7.1 lib/vcr/deprecations/cassette.rb
vcr-1.7.0 lib/vcr/deprecations/cassette.rb