Class: Perfgate::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/perfgate/cli.rb,
lib/perfgate/cli/run_command.rb,
lib/perfgate/cli/compare_command.rb,
lib/perfgate/cli/run_comparison_reporter.rb

Overview

Entry point for the baseline executable. run and compare are implemented (Milestones 1-4); init, report, doctor, and schema are planned for later milestones (spec section 10).

Defined Under Namespace

Classes: CompareCommand, RunCommand, RunComparisonReporter

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CLI

Returns a new instance of CLI.



12
13
14
# File 'lib/perfgate/cli.rb', line 12

def initialize(argv)
  @argv = argv
end

Class Method Details

.start(argv) ⇒ Object



8
9
10
# File 'lib/perfgate/cli.rb', line 8

def self.start(argv)
  new(argv).run
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/perfgate/cli.rb', line 16

def run
  dispatch(*@argv)
rescue Perfgate::ConfigurationError => e
  warn "baseline: #{e.message}"
  2
rescue Perfgate::ResultBundleError, Perfgate::WorkloadError => e
  warn "baseline: #{e.message}"
  3
rescue Perfgate::Error => e
  warn "baseline: #{e.message}"
  1
end