# File lib/rubygems/package.rb, line 50 50: def self.open(io, mode = "r", signer = nil, &block) 51: tar_type = case mode 52: when 'r' then TarInput 53: when 'w' then TarOutput 54: else 55: raise "Unknown Package open mode" 56: end 57: 58: tar_type.open(io, signer, &block) 59: end
# File lib/rubygems/package.rb, line 61 61: def self.pack(src, destname, signer = nil) 62: TarOutput.open(destname, signer) do |outp| 63: dir_class.chdir(src) do 64: outp.metadata = (file_class.read("RPA/metadata") rescue nil) 65: find_class.find('.') do |entry| 66: case 67: when file_class.file?(entry) 68: entry.sub!(%{\./}, "") 69: next if entry =~ /\ARPA\// 70: stat = File.stat(entry) 71: outp.add_file_simple(entry, stat.mode, stat.size) do |os| 72: file_class.open(entry, "rb") do |f| 73: os.write(f.read(4096)) until f.eof? 74: end 75: end 76: when file_class.dir?(entry) 77: entry.sub!(%{\./}, "") 78: next if entry == "RPA" 79: outp.mkdir(entry, file_class.stat(entry).mode) 80: else 81: raise "Don't know how to pack this yet!" 82: end 83: end 84: end 85: end 86: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.