api: fix generic api path functions
This commit is contained in:
parent
ea7540be82
commit
489f5ed9d1
@ -7,10 +7,9 @@ module Homebrew
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module Analytics
|
module Analytics
|
||||||
|
class << self
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
module_function
|
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def analytics_api_path
|
def analytics_api_path
|
||||||
"analytics"
|
"analytics"
|
||||||
@ -23,6 +22,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require "extend/os/api/analytics"
|
require "extend/os/api/analytics"
|
||||||
|
|||||||
@ -9,10 +9,9 @@ module Homebrew
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module Bottle
|
module Bottle
|
||||||
|
class << self
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
module_function
|
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def bottle_api_path
|
def bottle_api_path
|
||||||
"bottle"
|
"bottle"
|
||||||
@ -90,6 +89,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require "extend/os/api/bottle"
|
require "extend/os/api/bottle"
|
||||||
|
|||||||
@ -7,14 +7,14 @@ module Homebrew
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module Cask
|
module Cask
|
||||||
|
class << self
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
module_function
|
|
||||||
|
|
||||||
sig { params(name: String).returns(Hash) }
|
sig { params(name: String).returns(Hash) }
|
||||||
def fetch(name)
|
def fetch(name)
|
||||||
Homebrew::API.fetch "cask/#{name}.json"
|
Homebrew::API.fetch "cask/#{name}.json"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,10 +7,9 @@ module Homebrew
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module Formula
|
module Formula
|
||||||
|
class << self
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
module_function
|
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def formula_api_path
|
def formula_api_path
|
||||||
"formula"
|
"formula"
|
||||||
@ -23,6 +22,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require "extend/os/api/formula"
|
require "extend/os/api/formula"
|
||||||
|
|||||||
@ -7,10 +7,9 @@ module Homebrew
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module Versions
|
module Versions
|
||||||
|
class << self
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
module_function
|
|
||||||
|
|
||||||
def formulae
|
def formulae
|
||||||
# The result is cached by Homebrew::API.fetch
|
# The result is cached by Homebrew::API.fetch
|
||||||
Homebrew::API.fetch "versions-formulae.json"
|
Homebrew::API.fetch "versions-formulae.json"
|
||||||
@ -49,4 +48,5 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user