method
pack
v1_9_3_392 -
Show latest stable
-
0 notes -
Class: Package
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
pack(src, destname, signer = nil)
public
Hide source
# File lib/rubygems/package.rb, line 46 def self.pack(src, destname, signer = nil) TarOutput.open(destname, signer) do |outp| dir_class.chdir(src) do outp.metadata = (file_class.read("RPA/metadata") rescue nil) find_class.find('.') do |entry| case when file_class.file?(entry) entry.sub!(%{\./}, "") next if entry =~ /\ARPA\// stat = File.stat(entry) outp.add_file_simple(entry, stat.mode, stat.size) do |os| file_class.open(entry, "rb") do |f| os.write(f.read(4096)) until f.eof? end end when file_class.dir?(entry) entry.sub!(%{\./}, "") next if entry == "RPA" outp.mkdir(entry, file_class.stat(entry).mode) else raise "Don't know how to pack this yet!" end end end end end