2025-06-04 22:30:47 -04:00
|
|
|
# typed: strict
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "pkg_version"
|
|
|
|
|
|
|
|
module Homebrew
|
|
|
|
# A stub for a formula, with only the information needed to fetch the bottle manifest.
|
|
|
|
class FormulaStub < T::Struct
|
|
|
|
const :name, String
|
|
|
|
const :pkg_version, PkgVersion
|
|
|
|
const :rebuild, Integer
|
|
|
|
const :sha256, T.nilable(String)
|
|
|
|
|
2025-06-05 03:31:21 -04:00
|
|
|
sig { params(name: String, array: [String, Integer, T.nilable(String)]).returns(FormulaStub) }
|
|
|
|
def self.from_array(name, array)
|
2025-06-04 22:30:47 -04:00
|
|
|
new(
|
2025-06-05 03:31:21 -04:00
|
|
|
name: name,
|
|
|
|
pkg_version: PkgVersion.parse(array[0]),
|
|
|
|
rebuild: array[1],
|
|
|
|
sha256: array[2],
|
2025-06-04 22:30:47 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|