Sha256: c187cfe99641128daec5b4e3771f0d555279b71608c22c1e449e849adf10db15

Contents?: true

Size: 294 Bytes

Versions: 1

Compression:

Stored size: 294 Bytes

Contents

class URLTempfile < Tempfile

  def initialize(url)
    @url = URI.parse(url)

    begin
      super('url', Dir.tmpdir, :encoding => 'ascii-8bit')

      Net::HTTP.start(@url.host) do |http|
        resp = http.get(@url.path)
        self.write resp.body
      end
    ensure
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moxify-0.1.5 lib/moxify/url_tempfile.rb