Class: Homebrew::DevCmd::FormulaAnalytics Private

Inherits:
AbstractCommand show all
Defined in:
dev-cmd/formula-analytics.rb,
sorbet/rbi/dsl/homebrew/dev_cmd/formula_analytics.rbi

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

Defined Under Namespace

Classes: Args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, dev_cmd?, #initialize, parser, ruby_cmd?

Methods included from Utils::Output::Mixin

#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_once, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_cannot_install, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_removed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#args ⇒ Homebrew::DevCmd::FormulaAnalytics::Args

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.



10
# File 'sorbet/rbi/dsl/homebrew/dev_cmd/formula_analytics.rbi', line 10

def args; end

#run ⇒ void

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.

This method returns an undefined value.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'dev-cmd/formula-analytics.rb', line 66

def run
  influx = Utils::Analytics::Influx.new
  influx.setup_python
  if args.setup?
    SystemCommand.safe_system influx.venv_python, influx.influxdb_query_script, "--check"
    return
  end

  categories = []
  categories << :build_error if args.build_error?
  categories << :cask_install if args.cask_install?
  categories << :formula_install if args.install?
  categories << :formula_install_on_request if args.install_on_request?
  categories << :homebrew_devcmdrun_developer if args.homebrew_devcmdrun_developer?
  categories << :homebrew_env_config if args.homebrew_env_config?
  categories << :homebrew_os_arch_ci if args.homebrew_os_arch_ci?
  categories << :homebrew_prefixes if args.homebrew_prefixes?
  categories << :homebrew_versions if args.homebrew_versions?
  categories << :os_versions if args.os_version?
  categories << :command_run if args.brew_command_run?
  categories << :command_run_options if args.brew_command_run_options?
  categories << :test_bot_test if args.brew_test_bot_test?

  influx.query(categories:, days_ago: (args.days_ago || 30).to_i,
               all_core_formulae_json: args.all_core_formulae_json?).each do |json|
    puts JSON.pretty_generate(json)
  end
end