/usr/lib/ruby/vendor_ruby/typhoeus/hydra/block_connection.rb is in ruby-typhoeus 0.6.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 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
|