Module: FileProxy::Proxies::HttpProxy
- Defined in:
- lib/file_proxy/proxies/http_proxy.rb
Instance Method Summary collapse
Instance Method Details
#open(url, *args, &blk) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/file_proxy/proxies/http_proxy.rb', line 4 def open url, *args, &blk uri = URI.parse url data = Net::HTTP.get uri buffer = '/tmp/' + Time.now.to_s + rand(1_000_000_000_000).to_s ::FileProxy::OriginalFile.open buffer, 'w+' do |f| f.print data end ::FileProxy::OriginalFile.open buffer, *args, &blk end |