Sha256: 4e02763e76bfc7d1de1e387883b41b0f7205ef1544c764186cae7ba8796e7998

Contents?: true

Size: 633 Bytes

Versions: 6

Compression:

Stored size: 633 Bytes

Contents

require 'java'

require 'sane'

module SensibleSwing
  
  class MainWindow < javax.swing.JFrame
    def self.download full_url, to_here
      require 'open-uri'
      require 'openssl'
      eval("OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE") if full_url =~ /https/
      writeOut = open(to_here, "wb")
      writeOut.write(open(full_url).read)
      writeOut.close
    end
    
    def self.download_to_string full_url
       require 'tempfile'
       to = Tempfile.new 'abc'
       download(full_url, to.path)
       out = File.binread(to.path)
       to.delete
       out
    end
    
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sensible-cinema-0.28.0 lib/gui/sensible-cinema-dependencies.rb
sensible-cinema-0.27.0 lib/gui/sensible-cinema-dependencies.rb
sensible-cinema-0.26.3 lib/gui/sensible-cinema-dependencies.rb
sensible-cinema-0.26.2 lib/gui/sensible-cinema-dependencies.rb
sensible-cinema-0.26.1 lib/gui/sensible-cinema-dependencies.rb
sensible-cinema-0.26.0 lib/sensible-cinema-dependencies.rb