Sha256: 824b14a9e63193184eb729d53488552b1d83730931fff3ff2f94c52b8a483ce1

Contents?: true

Size: 888 Bytes

Versions: 6861

Compression:

Stored size: 888 Bytes

Contents

module Typhoeus
  class Hydra

    # This module handles the blocked connection request mode on
    # the hydra side, where only stubbed requests
    # are allowed.
    # Connection blocking needs to be turned on:
    #   Typhoeus.configure do |config|
    #     config.block_connection = true
    #   end
    #
    # When trying to do real requests a NoStub error
    # is raised.
    #
    # @api private
    module BlockConnection

      # Overrides add in order to check before if block connection
      # is turned on. If thats the case a NoStub error is
      # raised.
      #
      # @example Add the request.
      #   hydra.add(request)
      #
      # @param [ Request ] request The request to enqueue.
      def add(request)
        if request.blocked?
          raise Typhoeus::Errors::NoStub.new(request)
        else
          super
        end
      end
    end
  end
end

Version data entries

6,861 entries across 6,858 versions & 28 rubygems

Version Path
ory-client-0.0.1.alpha31 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-client-0.0.1.alpha30 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-client-0.0.1.alpha29 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-client-0.0.1.alpha28 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-client-0.0.1.alpha27 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-client-0.0.1.alpha24 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-client-0.0.1.alpha23 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.8.0.alpha2 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-client-0.0.1.alpha21 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-keto-client-0.7.0.alpha1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-keto-client-0.7.0.alpha0 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.7.6.alpha7 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.7.6.alpha6 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.7.6.alpha5 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.7.6.alpha4 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.7.6.alpha3 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.7.6.alpha1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
ory-kratos-client-0.7.5.alpha2 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
cloudsmith-api-0.57.1 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb
mfk_openapi_ruby_client-1.0.0 vendor/bundle/ruby/2.7.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/block_connection.rb