mogilefs-client.git  about / heads / tags
MogileFS client library for Ruby
blob 9fe9faa728e570a6e759edc6b24bc0381beee647 429 bytes (raw)
$ git show v3.7.0:lib/mogilefs/nhp_fake.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 
# :enddoc:
require 'net/http'

# This is just for folks that don't have net-http-persistent
class MogileFS::NhpFake # :nodoc:
  attr_accessor :read_timeout, :open_timeout

  def initialize(name)
    @read_timeout = @open_timeout = nil
  end

  def request(uri, req) # :nodoc:
    http = Net::HTTP.new(uri.host, uri.port)
    http.read_timeout = @read_timeout
    http.open_timeout = @open_timeout
    http.request(req)
  end
end

git clone https://yhbt.net/mogilefs-client.git