23 lines
558 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
module UnpackStrategy
2020-08-09 06:09:05 +02:00
# Strategy for unpacking uncompressed files.
class Uncompressed
2020-10-20 12:03:48 +02:00
extend T::Sig
include UnpackStrategy
def extract_nestedly(prioritise_extension: false, **options)
extract(**options)
end
private
2020-10-20 12:03:48 +02:00
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
def extract_to_dir(unpack_dir, basename:, verbose:)
FileUtils.cp path, unpack_dir/basename, preserve: true, verbose: verbose
end
end
end