Class: Readorder::Commands::Analyze

Inherits:
Readorder::Command show all
Defined in:
lib/readorder/commands/analyze.rb

Overview

Analyze the list of files to sort and give a report

Instance Attribute Summary

Attributes inherited from Readorder::Command

#analyzer, #filelist, #options, #output

Instance Method Summary collapse

Methods inherited from Readorder::Command

#after, #before, command_name, #command_name, commands, #error, find, #get_physical?, inherited, #initialize, #logger, #results, #results_dbfile, #shutdown

Constructor Details

This class inherits a constructor from Readorder::Command

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
# File 'lib/readorder/commands/analyze.rb', line 7

def run
  analyzer.collect_data
  output.puts @analyzer.summary_report
  if options['data-csv'] then
    File.open( options['data-csv'], "w+") { |f| analyzer.dump_good_data_to( f ) }
    logger.info "dumped #{analyzer.good_data.size} rows to #{options['data-csv']}"
  end
end