(url, &block)
| 272 | end |
| 273 | |
| 274 | private def start_http(url, &block) |
| 275 | http = Net::HTTP.new(url.host, url.port) |
| 276 | http.set_debug_output($stderr) if ENV["DEBUG"] |
| 277 | http.use_ssl = true |
| 278 | if block_given? |
| 279 | http.start(&block) |
| 280 | else |
| 281 | http |
| 282 | end |
| 283 | end |
| 284 | |
| 285 | def close |
| 286 | return if @http.nil? |