Sha256: 50e575b8699670b8b3b26803af0c4b3f0d457549c408afce5a164ccf6d452fd4

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

$:.unshift(File.dirname(__FILE__)) unless
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

require 'cgi'
require 'openssl'
require 'socket'
require 'uri'

require 'excon/connection'
require 'excon/errors'
require 'excon/response'

module Excon

  unless const_defined?(:VERSION)
    VERSION = '0.3.8'
  end

  unless const_defined?(:CHUNK_SIZE)
    CHUNK_SIZE = 1048576 # 1 megabyte
  end

  # Status of ssl peer verification
  @ssl_verify_peer = true
  def self.ssl_verify_peer
    @ssl_verify_peer
  end

  # change the status of ssl peer verification
  def self.ssl_verify_peer=(new_ssl_verify_peer)
    @ssl_verify_peer = new_ssl_verify_peer
  end

  # @see Connection#initialize
  #  Initializes a new keep-alive session for a given remote host
  #
  #   @param [String] url The destination URL
  #   @param [Hash<Symbol, >] params One or more option params to set on the Connection instance
  #   @return [Connection] A new Excon::Connection instance
  def self.new(url, params = {})
    Excon::Connection.new(url, params)
  end

  %w{connect delete get head options post put trace}.each do |method|
    eval <<-DEF
      def self.#{method}(url, params = {}, &block)
        new(url).request(params.merge!(:method => :#{method}), &block)
      end
    DEF
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
excon-0.3.8 lib/excon.rb