30 lines
696 B
Ruby
Raw Normal View History

# typed: strict
# frozen_string_literal: true
2018-09-11 19:21:18 +02:00
module UnpackStrategy
2020-08-09 06:09:05 +02:00
# Strategy for unpacking pax archives.
2018-09-11 19:21:18 +02:00
class Pax
include UnpackStrategy
2024-07-05 22:29:41 -07:00
sig { override.returns(T::Array[String]) }
2018-09-11 19:21:18 +02:00
def self.extensions
[".pax"]
end
sig { override.params(_path: Pathname).returns(T::Boolean) }
2018-09-11 19:21:18 +02:00
def self.can_extract?(_path)
false
end
private
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
2018-09-11 19:21:18 +02:00
def extract_to_dir(unpack_dir, basename:, verbose:)
system_command! "pax",
2018-11-02 17:18:07 +00:00
args: ["-rf", path],
chdir: unpack_dir,
2024-03-07 16:20:20 +00:00
verbose:
2018-09-11 19:21:18 +02:00
end
end
end