Module: Homebrew::API::Analytics Private

Extended by:
T::Sig
Defined in:
api/analytics.rb,
extend/os/linux/api/analytics.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 analytics JSON API.

Class Method Summary collapse

Class Method Details

.analytics_api_pathString Also known as: generic_analytics_api_path

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.

Returns:



14
15
16
17
18
19
20
# File 'api/analytics.rb', line 14

def analytics_api_path
  return generic_analytics_api_path if
    Homebrew::EnvConfig.force_homebrew_on_linux? ||
    Homebrew::EnvConfig.force_homebrew_core_repo_on_linux?

  "analytics-linux"
end

.fetch(category, days) ⇒ 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)


20
21
22
# File 'api/analytics.rb', line 20

def fetch(category, days)
  Homebrew::API.fetch "#{analytics_api_path}/#{category}/#{days}d.json"
end