lib/reaver/walk.rb in reaver-0.11.1 vs lib/reaver/walk.rb in reaver-0.12.0
- old
+ new
@@ -4,14 +4,15 @@
require 'fileutils'
module Reaver
# extract, move file if need
class Walk
- def initialize(filename, dest, keep_name)
+ def initialize(filename, dest, keep_name, strip)
@filename = filename
@dest = dest
@keep_name = keep_name || false
+ @strip = strip
check_extension
check_name
x
end
@@ -61,9 +62,9 @@
def extract_gzip
ext = @extension.split('/').last
puts "Extracting #{ext} archive #{@filename} at #{@final_dest}..."
FileUtils.mkdir_p @final_dest
- `tar x --strip-components=1 -f #{@filename} --one-top-level=#{@final_dest}`
+ `tar x --strip-components=#{@strip} -f #{@filename} --one-top-level=#{@final_dest}`
end
end
end