Sha256: 16c7c4035068a310096163adda7062e6cbc5068c4c99b29c4e5cb4d03050e03c
Contents?: true
Size: 879 Bytes
Versions: 4
Compression:
Stored size: 879 Bytes
Contents
require 'net/http' require 'date' module Rip class HTTPPackage < Package handles 'http://' def exists? code = Net::HTTP.get_response(URI.parse(source)).code code.to_i == 200 end memoize :name def name source.split('/').last end def meta_package? true end def fetch! FileUtils.rm_rf cache_path FileUtils.mkdir_p cache_path File.open(File.join(cache_path, name), 'w') do |f| f.puts Net::HTTP.get(URI.parse(source)) end end def unpack! installer = Installer.new installer.install actual_package installer.manager.sources[actual_package.name] = source installer.manager.save end def version actual_package ? actual_package.version : super end def actual_package Package.for(File.join(cache_path, name)) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rip-0.0.4 | lib/rip/packages/http_package.rb |
rip-0.0.5 | lib/rip/packages/http_package.rb |
rip-0.0.3 | lib/rip/packages/http_package.rb |
rip-0.0.2 | lib/rip/packages/http_package.rb |