A ScanReportPrinter producing a summary (number of differences) only.
Each difference is handed to the printer as described in the format as described e. g. in DirectTableScan#run
# File lib/rubyrep/scan_report_printers/scan_summary_reporter.rb, line 65 def report_difference(type, row) scan_result[type] += 1 end
A scan of the given ‘left’ table and corresponding ‘right’ table is executed. Needs to yield so that the actual scan can be executed.
# File lib/rubyrep/scan_report_printers/scan_summary_reporter.rb, line 34 def scan(left_table, right_table) self.left_table = left_table self.right_table = right_table self.scan_result = {:conflict => 0, :left => 0, :right => 0} header = left_table.clone header << " / " << right_table if left_table != right_table $stdout.write "#{header.rjust(36)} " yield # Give control back so that the actual table scan can be done. if only_totals $stdout.write "#{rjust_value(scan_result[:conflict] + scan_result[:left] + scan_result[:right])}" else $stdout.write "#{rjust_value(scan_result[:conflict])} " + "#{rjust_value(scan_result[:left])} " + "#{rjust_value(scan_result[:right])}" end $stdout.puts end
Generated with the Darkfish Rdoc Generator 2.