Module: Homebrew::API::CaskSource Private

Extended by:
T::Sig
Defined in:
api/cask-source.rb

Overview

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Helper functions for using the cask source API.

Class Method Summary collapse

Class Method Details

.available?(token) ⇒ Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (Boolean)


19
20
21
22
23
24
# File 'api/cask-source.rb', line 19

def available?(token)
  fetch token
  true
rescue ArgumentError
  false
end

.fetch(token) ⇒ Hash

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (Hash)


14
15
16
# File 'api/cask-source.rb', line 14

def fetch(token)
  Homebrew::API.fetch "cask-source/#{token}.rb", json: false
end