module GitLab::Exporter::CLI

Stores runner classes in a single place

The entry point is the module method “for” which takes the name of a runner. In case the runner is invalid it will return a NullRunner which fails with an InvalidCLICommand error, which contains the general application usage instructions.

Constants

EXECUTABLE_NAME

Public Class Methods

commands() click to toggle source
# File lib/gitlab_exporter/cli.rb, line 325
def self.commands
  [
    GIT,
    DatabaseTupleStats,
    DatabaseRowCounts,
    Process,
    GitProcess,
    SidekiqRunner,
    Server
  ].each_with_object({}) do |command_class, commands|
    commands[command_class::COMMAND_NAME] = command_class
    commands
  end
end
for(name) click to toggle source
# File lib/gitlab_exporter/cli.rb, line 13
def self.for(name)
  commands.fetch(name, NullRunner)
end