Sha256: 82b3575a276090b0acf399faf443032707cc4c2f444745738ba1438dfa585720
Contents?: true
Size: 1.29 KB
Versions: 4
Compression:
Stored size: 1.29 KB
Contents
# Copyright:: (c) Autotelik Media Ltd 2011 # Author :: Tom Statter # Date :: Dec 2012 # License:: MIT # # Details:: Store and report stats # module DataShift class Reporter include DataShift::Logging attr_accessor :processed_object_count, :loaded_objects, :failed_objects def initialize() reset end def reset() @processed_object_count = 0 @loaded_objects, @failed_objects = [], [] end def add_loaded_object(object) @loaded_objects << object unless(object.nil? || @loaded_objects.include?(object)) end def add_failed_object(object) @failed_objects << object unless( object.nil? || @failed_objects.include?(object)) end def report loaded_objects.compact! if(loaded_objects) puts "\nProcessing Summary Report" puts ">>>>>>>>>>>>>>>>>>>>>>>>>\n" puts "Processed total of #{processed_object_count} #{processed_object_count > 1 ? 'entries' : 'entry'}" puts "#{loaded_objects.size} objects were succesfully processed." puts "There were NO failures." if failed_objects.empty? puts "WARNING : Check logs : #{failed_objects.size} rows contained errors and #{failed_objects.size} records NOT created." unless failed_objects.empty? end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
datashift-0.15.0 | lib/loaders/reporter.rb |
datashift-0.14.0 | lib/loaders/reporter.rb |
datashift-0.13.0 | lib/loaders/reporter.rb |
datashift-0.12.1 | lib/loaders/reporter.rb |