Class: Inspector::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/inspector/runner.rb

Overview

Processes based on the provided command line arguments the scan of the file or shows the last processed files.

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Runner

Initializes runner and invokes Options with the command line arguments provided



12
13
14
# File 'lib/inspector/runner.rb', line 12

def initialize(argv)
  @options = Options.new(argv)
end

Instance Method Details

#runObject

Runs the Separator or shows the requested valid or invalid file. To show the file ‘less’ is used.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/inspector/runner.rb', line 18

def run
  opts = @options.options
  if opts[:infile]
    separator = Separator.new
    separator.process(opts)
    separator.print_statistics(opts)
    @options.save_result_files opts
  end
  if show = opts[:show]
    system "less #{@options.get_file_from_history show}"
  end
end