Sha256: 0ae4eed061979dd38d514d77c89cecd624368cdebbd4c8de6897954097cac5f6

Contents?: true

Size: 1.6 KB

Versions: 20

Compression:

Stored size: 1.6 KB

Contents

# frozen_string_literal: true

require "httpx/version"

require "httpx/extensions"

require "httpx/errors"
require "httpx/utils"
require "httpx/punycode"
require "httpx/domain_name"
require "httpx/altsvc"
require "httpx/callbacks"
require "httpx/loggable"
require "httpx/registry"
require "httpx/transcoder"
require "httpx/timers"
require "httpx/pool"
require "httpx/headers"
require "httpx/request"
require "httpx/response"
require "httpx/options"
require "httpx/chainable"

require "mutex_m"
# Top-Level Namespace
#
module HTTPX
  EMPTY = [].freeze

  # All plugins should be stored under this module/namespace. Can register and load
  # plugins.
  #
  module Plugins
    @plugins = {}
    @plugins.extend(Mutex_m)

    # Loads a plugin based on a name. If the plugin hasn't been loaded, tries to load
    # it from the load path under "httpx/plugins/" directory.
    #
    def self.load_plugin(name)
      h = @plugins
      unless (plugin = h.synchronize { h[name] })
        require "httpx/plugins/#{name}"
        raise "Plugin #{name} hasn't been registered" unless (plugin = h.synchronize { h[name] })
      end
      plugin
    end

    # Registers a plugin (+mod+) in the central store indexed by +name+.
    #
    def self.register_plugin(name, mod)
      h = @plugins
      h.synchronize { h[name] = mod }
    end
  end

  # :nocov:
  def self.const_missing(const_name)
    super unless const_name == :Client
    warn "DEPRECATION WARNING: the class #{self}::Client is deprecated. Use #{self}::Session instead."
    Session
  end
  # :nocov:

  extend Chainable
end

require "httpx/session"
require "httpx/session_extensions"

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
httpx-0.22.2 lib/httpx.rb
httpx-0.22.1 lib/httpx.rb
httpx-0.22.0 lib/httpx.rb
httpx-0.21.1 lib/httpx.rb
httpx-0.21.0 lib/httpx.rb
httpx-0.20.5 lib/httpx.rb
httpx-0.20.4 lib/httpx.rb
httpx-0.20.3 lib/httpx.rb
httpx-0.20.2 lib/httpx.rb
httpx-0.20.1 lib/httpx.rb
httpx-0.20.0 lib/httpx.rb
httpx-0.19.8 lib/httpx.rb
httpx-0.19.7 lib/httpx.rb
httpx-0.19.6 lib/httpx.rb
httpx-0.19.5 lib/httpx.rb
httpx-0.19.4 lib/httpx.rb
httpx-0.19.3 lib/httpx.rb
httpx-0.19.2 lib/httpx.rb
httpx-0.19.1 lib/httpx.rb
httpx-0.19.0 lib/httpx.rb