mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
27 lines
547 B
Ruby
27 lines
547 B
Ruby
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
module Homebrew
|
|
module API
|
|
# Helper functions for using the formula JSON API.
|
|
#
|
|
# @api private
|
|
module Formula
|
|
class << self
|
|
extend T::Sig
|
|
|
|
sig { returns(String) }
|
|
def formula_api_path
|
|
"formula"
|
|
end
|
|
alias generic_formula_api_path formula_api_path
|
|
|
|
sig { params(name: String).returns(Hash) }
|
|
def fetch(name)
|
|
Homebrew::API.fetch "#{formula_api_path}/#{name}.json"
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|