Permalink
Browse files

code cleanup

  • Loading branch information...
alor committed Nov 17, 2011
1 parent 4b3fb4f commit 16b6400a12efc25fc77ee5daed746b2069a12cb6
Showing with 2 additions and 12 deletions.
  1. +0 −2 lib/zip/zip_entry.rb
  2. +2 −8 lib/zip/zip_file.rb
  3. +0 −2 lib/zip/zipfilesystem.rb
View
@@ -120,7 +120,6 @@ def initialize(zipfile = "", name = "", comment = "", extra = "",
@unix_uid = nil
@unix_gid = nil
@unix_perms = nil
#puts "--> ZipEntry.new #{@zipfile} #{@name}"
# @posix_acl = nil
# @ntfs_acl = nil
@@ -412,7 +411,6 @@ def set_extra_attributes_on_path(destPath) # :nodoc:
end
def write_c_dir_entry(io) #:nodoc:all
#puts "--> write_c_dir_entry [%o]" % (@unix_perms.nil? ? 0 : @unix_perms)
case @fstype
when FSTYPE_UNIX
ft = nil
View
@@ -135,7 +135,6 @@ def get_output_stream(entry, permissionInt = nil, &aProc)
raise ArgumentError,
"cannot open stream to directory entry - '#{newEntry}'"
end
#puts "--> [%o]" % permissionInt
newEntry.unix_perms = permissionInt
zipStreamableEntry = ZipStreamableStream.new(newEntry)
@entrySet << zipStreamableEntry
@@ -192,16 +191,14 @@ def extract(entry, destPath, &onExistsProc)
# Commits changes that has been made since the previous commit to
# the zip archive.
def commit
#puts "--> commit"
return if ! commit_required?
#puts "--> commit real"
on_success_replace(name) {
|tmpFile|
ZipOutputStream.open(tmpFile) {
|zos|
@entrySet.each { |e|
#puts "--> commit [#{e.name}] perm [%o]" % e.unix_perms
@entrySet.each {
|e|
e.write_to_zip_output_stream(zos)
e.dirty = false
}
@@ -229,9 +226,6 @@ def close
# Returns true if any changes has been made to this archive since
# the previous commit
def commit_required?
#puts "--> cr? entryset: [#{@entrySet != @storedEntries}]"
#puts "--> cr? [#{@entrySet.inspect}]"
#puts "--> cr? [#{@storedEntries.inspect}]"
@entrySet.each do |e|
return true if e.dirty
end
View
@@ -225,7 +225,6 @@ def directory?(fileName)
end
def open(fileName, openMode = "r", permissionInt = 0644, &block)
#puts "--> open #{fileName}"
openMode.gsub!("b", "") # ignore b option
case openMode
when "r"
@@ -270,7 +269,6 @@ def chmod (modeInt, *filenames)
e.unix_perms = modeInt
e.externalFileAttributes = modeInt << 16
e.dirty = true
#puts "--> chmod [%o] [%o]" % [e.unix_perms, e.externalFileAttributes]
}
filenames.size
end

0 comments on commit 16b6400

Please sign in to comment.