Skip to content

Commit

Permalink
Merge pull request #17883 from bevanjkay/unpack-strategy-types
Browse files Browse the repository at this point in the history
  • Loading branch information
p-linnane authored Jul 28, 2024
2 parents 12d0d7b + a196898 commit 6509dc1
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def extract_nestedly(to: nil, basename: nil, verbose: false, prioritize_extensio
end
end

sig { returns(T::Array[String]) }
sig { returns(T.any(T::Array[Cask::Cask], T::Array[Formula])) }
def dependencies
[]
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/air.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def self.can_extract?(path)
path.magic_number.match?(/.{59}#{Regexp.escape(mime_type)}/)
end

sig { returns(T.nilable(T::Array[Cask::Cask])) }
sig { returns(T::Array[Cask::Cask]) }
def dependencies
@dependencies ||= T.let([Cask::CaskLoader.load("adobe-air")], T.nilable(T::Array[Cask::Cask]))
end
Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/unpack_strategy/cab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ def self.can_extract?(path)
path.magic_number.match?(/\AMSCF/n)
end

sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["cabextract"]], T.nilable(T::Array[Formula]))
end

sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
def extract_to_dir(unpack_dir, basename:, verbose:)
system_command! "cabextract",
args: ["-d", unpack_dir, "--", path],
env: { "PATH" => PATH.new(Formula["cabextract"].opt_bin, ENV.fetch("PATH")) },
verbose:
end

sig { returns(T.nilable(T::Array[Formula])) }
def dependencies
@dependencies ||= T.let([Formula["cabextract"]], T.nilable(T::Array[Formula]))
end
end
end
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/generic_unar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(_path)
false
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["unar"]], T.nilable(T::Array[Formula]))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/lha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(path)
path.magic_number.match?(/\A..-(lh0|lh1|lz4|lz5|lzs|lh\\40|lhd|lh2|lh3|lh4|lh5)-/n)
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["lha"]], T.nilable(T::Array[Formula]))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/lzip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(path)
path.magic_number.match?(/\ALZIP/n)
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["lzip"]], T.nilable(T::Array[Formula]))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/lzma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(path)
path.magic_number.match?(/\A\]\000\000\200\000/n)
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["xz"]], T.nilable(T::Array[Formula]))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/p7zip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(path)
path.magic_number.match?(/\A7z\xBC\xAF\x27\x1C/n)
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["p7zip"]], T.nilable(T::Array[Formula]))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/rar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(path)
path.magic_number.match?(/\ARar!/n)
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["libarchive"]], T.nilable(T::Array[Formula]))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/xz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(path)
path.magic_number.match?(/\A\xFD7zXZ\x00/n)
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["xz"]], T.nilable(T::Array[Formula]))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/unpack_strategy/zstd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.can_extract?(path)
path.magic_number.match?(/\x28\xB5\x2F\xFD/n)
end

sig { returns(T.nilable(T::Array[Formula])) }
sig { returns(T::Array[Formula]) }
def dependencies
@dependencies ||= T.let([Formula["zstd"]], T.nilable(T::Array[Formula]))
end
Expand Down

0 comments on commit 6509dc1

Please sign in to comment.