api: fix generic api path functions

This commit is contained in:
Rylan Polster 2021-08-09 16:48:13 -04:00
parent ea7540be82
commit 489f5ed9d1
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
5 changed files with 122 additions and 122 deletions

View File

@ -7,10 +7,9 @@ module Homebrew
#
# @api private
module Analytics
class << self
extend T::Sig
module_function
sig { returns(String) }
def analytics_api_path
"analytics"
@ -24,5 +23,6 @@ module Homebrew
end
end
end
end
require "extend/os/api/analytics"

View File

@ -9,10 +9,9 @@ module Homebrew
#
# @api private
module Bottle
class << self
extend T::Sig
module_function
sig { returns(String) }
def bottle_api_path
"bottle"
@ -91,5 +90,6 @@ module Homebrew
end
end
end
end
require "extend/os/api/bottle"

View File

@ -7,10 +7,9 @@ module Homebrew
#
# @api private
module Cask
class << self
extend T::Sig
module_function
sig { params(name: String).returns(Hash) }
def fetch(name)
Homebrew::API.fetch "cask/#{name}.json"
@ -18,3 +17,4 @@ module Homebrew
end
end
end
end

View File

@ -7,10 +7,9 @@ module Homebrew
#
# @api private
module Formula
class << self
extend T::Sig
module_function
sig { returns(String) }
def formula_api_path
"formula"
@ -24,5 +23,6 @@ module Homebrew
end
end
end
end
require "extend/os/api/formula"

View File

@ -7,10 +7,9 @@ module Homebrew
#
# @api private
module Versions
class << self
extend T::Sig
module_function
def formulae
# The result is cached by Homebrew::API.fetch
Homebrew::API.fetch "versions-formulae.json"
@ -50,3 +49,4 @@ module Homebrew
end
end
end
end