26 lines
504 B
Ruby
Raw Normal View History

module UnpackStrategy
class Directory
include UnpackStrategy
using Magic
def self.extensions
[]
end
def self.can_extract?(path)
path.directory?
end
private
def extract_to_dir(unpack_dir, basename:, verbose:)
path.children.each do |child|
system_command! "cp",
2018-11-02 17:18:07 +00:00
args: ["-pR", child.directory? ? "#{child}/." : child, unpack_dir/child.basename],
verbose: verbose
end
end
end
end