Sha256: 9763da6a087b853b3e842643b7aaf56340c0e2e3e4d1b6a54f65b93cbf1de3b0

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require 'fileutils'

module VCR
  class Config
    class << self
      attr_reader :cassette_library_dir
      def cassette_library_dir=(cassette_library_dir)
        @cassette_library_dir = cassette_library_dir
        FileUtils.mkdir_p(cassette_library_dir) if cassette_library_dir
      end

      attr_writer :default_cassette_options
      def default_cassette_options
        @default_cassette_options ||= {}
        @default_cassette_options.merge!(:match_requests_on => RequestMatcher::DEFAULT_MATCH_ATTRIBUTES) unless @default_cassette_options.has_key?(:match_requests_on)
        @default_cassette_options
      end

      def stub_with(*http_stubbing_libraries)
        @http_stubbing_libraries = http_stubbing_libraries
      end

      def http_stubbing_libraries
        @http_stubbing_libraries ||= []
      end

      def ignore_localhost=(value)
        VCR.http_stubbing_adapter && VCR.http_stubbing_adapter.ignore_localhost = value
        @ignore_localhost = value
      end

      def ignore_localhost?
        VCR.http_stubbing_adapter ? VCR.http_stubbing_adapter.ignore_localhost? : @ignore_localhost
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vcr-1.3.3 lib/vcr/config.rb