Sha256: a7cdd7b87b7de0d65a35ed132db0897fbf3eb5b7f1833a1e06b389edfeaeef04

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

__DIR__ = File.dirname(__FILE__)

$LOAD_PATH.unshift __DIR__ unless
  $LOAD_PATH.include?(__DIR__) ||
  $LOAD_PATH.include?(File.expand_path(__DIR__))

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.1.0'
  end

  CHUNK_SIZE = 1048576 # 1 megabyte

  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.upcase}'), &block)
      end
    DEF
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
excon-0.1.0 lib/excon.rb