brew/Library/Homebrew/formula_stub.rb

25 lines
643 B
Ruby
Raw Normal View History

# 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)
new(
2025-06-05 03:31:21 -04:00
name: name,
pkg_version: PkgVersion.parse(array[0]),
rebuild: array[1],
sha256: array[2],
)
end
end
end