Class: MetricsSatellite::OptionParser

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/metrics_satellite/option_parser.rb

Defined Under Namespace

Classes: Argument

Constant Summary collapse

OPTIONS =
[
  "--type=",                     "(default:       -) 'collect' or 'post'",
  "--host=",                     "(default:       -) GrowthForecast host to send report",
  "--service=",                  "(default: metrics) GrowthForecast service name",
  "--section=",                  "(default: section) GrowthForecast section name",
  "--git=",                      "(default:      ./) git repository directory",
  "--app=",                      "(default:      ./) application directory",
  "--reports=",                  "(default: reports) collected reports directory",
  "--guideline-abc-complexity=", "(default:      15) threshold of ABC complexity",
  "--guideline-long-line=",      "(default:      80) threshold of long line",
  "--guideline-long-method=",    "(default:      10) threshold of long method",
  "--hotspots-cutoff=",          "(default:      10) threshold of change count",
  "--hotspots-time=",            "(default:      14) time span of git log target",
  "--no-brakeman",               "(default:   false) disable Brakeman",
  "--no-flay",                   "(default:   false) disable Flay",
  "--no-guideline",              "(default:   false) disable Guideline",
  "--no-hotspots",               "(default:   false) disable Hotspots",
  "--no-rails-best-practices",   "(default:   false) disable RailsBestPractices",
]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptionParser

Returns a new instance of OptionParser.



33
34
35
36
# File 'lib/metrics_satellite/option_parser.rb', line 33

def initialize(*)
  super
  configure_options
end

Class Method Details

.helpObject



29
30
31
# File 'lib/metrics_satellite/option_parser.rb', line 29

def self.help
  new.help
end

.parse!(argv) ⇒ Object



25
26
27
# File 'lib/metrics_satellite/option_parser.rb', line 25

def self.parse!(argv)
  new.parse!(argv)
end

Instance Method Details

#optionsObject



43
44
45
# File 'lib/metrics_satellite/option_parser.rb', line 43

def options
  @options ||= {}
end

#parse!Object



38
39
40
41
# File 'lib/metrics_satellite/option_parser.rb', line 38

def parse!(*)
  super
  options
end