Class: RDist::CommandLineInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/rdist/commandlineinterface.rb

Overview

CommandLineInterface is the main class used for the rdist command.

Constant Summary collapse

DEFAULT_OUTPUT =
$stdout

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv, output) ⇒ CommandLineInterface

:nodoc:



21
22
23
24
25
26
27
28
29
30
# File 'lib/rdist/commandlineinterface.rb', line 21

def initialize(argv, output) #:nodoc:
  @output = output
  @setting = Setting.for_argv(argv)
  @analyzer = @setting.analyzer
  @num_ranking = @setting.num_ranking

  analyze_all_targets(argv)
  print_banner()
  print_result()
end

Class Method Details

.analyze(argv, output = DEFAULT_OUTPUT) ⇒ Object

Parses argv and print analysis result to output. Analysis result is the distribution histogram and the rankings. If argv includes ‘–verbose’ option, then print all analyzing file names too.



12
13
14
15
16
17
18
19
# File 'lib/rdist/commandlineinterface.rb', line 12

def self.analyze(argv, output=DEFAULT_OUTPUT)
  begin
    new(argv, output)
  rescue OptionParser::ParseError => err
    puts err
    exit 1
  end
end