[ruby/net-http] Removed needless NullWriter class
https://github.com/ruby/net-http/commit/ddb2a81aed
This commit is contained in:
parent
2c76bb7ec0
commit
83a99bdbe6
@ -234,7 +234,7 @@ module TestNetHTTPUtils
|
|||||||
def new
|
def new
|
||||||
klass = Net::HTTP::Proxy(config('proxy_host'), config('proxy_port'))
|
klass = Net::HTTP::Proxy(config('proxy_host'), config('proxy_port'))
|
||||||
http = klass.new(config('host'), config('port'))
|
http = klass.new(config('host'), config('port'))
|
||||||
http.set_debug_output logfile()
|
http.set_debug_output logfile
|
||||||
http
|
http
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ module TestNetHTTPUtils
|
|||||||
end
|
end
|
||||||
|
|
||||||
def logfile
|
def logfile
|
||||||
$DEBUG ? $stderr : NullWriter.new
|
$stderr if $DEBUG
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@ -334,16 +334,6 @@ module TestNetHTTPUtils
|
|||||||
$test_net_http_data.force_encoding("ASCII-8BIT")
|
$test_net_http_data.force_encoding("ASCII-8BIT")
|
||||||
$test_net_http_data_type = 'application/octet-stream'
|
$test_net_http_data_type = 'application/octet-stream'
|
||||||
|
|
||||||
class NullWriter
|
|
||||||
def <<(_s); end
|
|
||||||
|
|
||||||
def puts(*_args); end
|
|
||||||
|
|
||||||
def print(*_args); end
|
|
||||||
|
|
||||||
def printf(*_args); end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.clean_http_proxy_env
|
def self.clean_http_proxy_env
|
||||||
orig = {
|
orig = {
|
||||||
'http_proxy' => ENV['http_proxy'],
|
'http_proxy' => ENV['http_proxy'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user