Skip to content

Commit

Permalink
Removed ftools dependency and replaced with FileUtils.
Browse files Browse the repository at this point in the history
  • Loading branch information
sam committed Jun 7, 2012
1 parent e9c90b2 commit 469d211
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/zip/zip.rb
@@ -1,7 +1,7 @@
require 'delegate' require 'delegate'
require 'singleton' require 'singleton'
require 'tempfile' require 'tempfile'
require 'ftools' require 'fileutils'
require 'stringio' require 'stringio'
require 'zlib' require 'zlib'
require 'zip/stdrubyext' require 'zip/stdrubyext'
Expand Down Expand Up @@ -663,8 +663,9 @@ def set_extra_attributes_on_path(destPath) # :nodoc:
# ignore setuid/setgid bits by default. honor if @restore_ownership # ignore setuid/setgid bits by default. honor if @restore_ownership
unix_perms_mask = 01777 unix_perms_mask = 01777
unix_perms_mask = 07777 if (@restore_ownership) unix_perms_mask = 07777 if (@restore_ownership)
File::chmod(@unix_perms & unix_perms_mask, destPath) if (@restore_permissions && @unix_perms) FileUtils::chmod(@unix_perms & unix_perms_mask, destPath) if (@restore_permissions && @unix_perms)
File::chown(@unix_uid, @unix_gid, destPath) if (@restore_ownership && @unix_uid && @unix_gid && Process::egid == 0) FileUtils::chown(@unix_uid, @unix_gid, destPath) if (@restore_ownership && @unix_uid && @unix_gid && Process::egid == 0)

# File::utimes() # File::utimes()
end end
end end
Expand Down Expand Up @@ -1567,7 +1568,7 @@ def on_success_replace(aFilename)
tmpFilename = tmpfile.path tmpFilename = tmpfile.path
tmpfile.close tmpfile.close
if yield tmpFilename if yield tmpFilename
File.move(tmpFilename, name) File.rename(tmpFilename, name)
end end
end end


Expand Down

0 comments on commit 469d211

Please sign in to comment.