2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-07-23 20:59:21 +02:00
|
|
|
module UnpackStrategy
|
2020-08-09 06:09:05 +02:00
|
|
|
# Strategy for unpacking uncompressed files.
|
2018-07-23 20:59:21 +02:00
|
|
|
class Uncompressed
|
|
|
|
include UnpackStrategy
|
|
|
|
|
2019-04-03 10:32:29 +01:00
|
|
|
def extract_nestedly(prioritise_extension: false, **options)
|
2018-07-30 22:23:26 +02:00
|
|
|
extract(**options)
|
|
|
|
end
|
2018-07-23 20:59:21 +02:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def extract_to_dir(unpack_dir, basename:, verbose:)
|
|
|
|
FileUtils.cp path, unpack_dir/basename, preserve: true, verbose: verbose
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|