lib/capsaicin/files/local.rb in capsaicin-0.1.5 vs lib/capsaicin/files/local.rb in capsaicin-0.1.6
- old
+ new
@@ -68,10 +68,21 @@
require 'zlib' unless defined? Zlib::GzipWriter
logger and logger.trace "tar -tzf #{src}"
_lstar Zlib::GzipReader.new(File.open(src, 'rb')), options, &block
end
+ def tar_x(src, options={}, &block)
+ logger and logger.trace "tar -xf #{src}"
+ _untar File.open(src, 'wb'), options, &block
+ end
+
+ def tar_xz(src, options={}, &block)
+ require 'zlib' unless defined? Zlib::GzipWriter
+ logger and logger.trace "tar -xzf #{src}"
+ _untar Zlib::GzipReader.new(File.open(src, 'rb')), options, &block
+ end
+
private
def _tar(os, src, options, &filter)
verbose = options[:v] || options[:verbose]
minitar = _minitar
@@ -128,7 +139,5 @@
Archive::Tar::Minitar
end
end
end
end
-
-Capistrano.plugin :local_files, Capsaicin::Files::Local