lib/rake/common/ziptask.rb in rake-delphi-0.0.4 vs lib/rake/common/ziptask.rb in rake-delphi-0.0.5
- old
+ new
@@ -34,11 +34,11 @@
end
class ZipTask < BasicTask
def initialize(task, zipfile, files, options = nil)
super(task)
- pp [zipfile, files] if trace?
+ Logger.trace(Logger::VERBOSE, [zipfile, files])
raise "zipfile name is not defined!" if zipfile.nil? || zipfile.empty?
@norubyzip = nil
@options = options || {}
begin
require 'zipruby'
@@ -50,18 +50,18 @@
end
end
raise "no ZIP library (nor zipruby nor rubyzip) found!" if @norubyzip
if defined? Zip::Archive
# zipruby used
- $stderr.puts '`zipruby` gem is used' if trace?
+ Logger.trace(Logger::VERBOSE, '`zipruby` gem is used')
Zip::Archive.open(zipfile, Zip::CREATE | Zip::TRUNC) do |z|
files.each do |f|
zip_addfile(z, f)
end
end
else
# work with rubyzip
- $stderr.puts '`rubyzip` gem is used' if trace?
+ Logger.trace(Logger::VERBOSE, '`rubyzip` gem is used')
File.unlink(zipfile) if File.exists?(zipfile)
Zip.options[:continue_on_exists_proc] = true
Zip::ZipFile.open(zipfile, Zip::ZipFile::CREATE) do |z|
files.each do |f|
zip_addfile(z, f)