Top Level Namespace
Defined Under Namespace
Modules: DateHelper, StackFu Classes: Array, String
Instance Method Summary collapse
-
#silently(&block) ⇒ Object
class ActiveResource::Connection # Creates new Net::HTTP instance for communication with # remote service and resources.
Instance Method Details
#silently(&block) ⇒ Object
class ActiveResource::Connection
# Creates new Net::HTTP instance for communication with
# remote service and resources.
def http
http = Net::HTTP.new(@site.host, @site.port)
http.use_ssl = @site.is_a?(URI::HTTPS)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl
http.read_timeout = @timeout if @timeout
#Here's the addition that allows you to see the output
http.set_debug_output $stderr
return http
end
end
106 107 108 109 110 111 112 |
# File 'lib/stackfu.rb', line 106 def silently(&block) warn_level = $VERBOSE $VERBOSE = nil result = block.call $VERBOSE = warn_level result end |