class AbstractImporter::Reporters::ProgressReporter

Attributes

pbar[R]

Public Instance Methods

batch_inserted(size) click to toggle source
# File lib/abstract_importer/reporters/progress_reporter.rb, line 37
def batch_inserted(size)
  pbar.inc size
end
finish_all(importer, ms) click to toggle source
# File lib/abstract_importer/reporters/progress_reporter.rb, line 14
def finish_all(importer, ms)
  pbar.finish
  io.puts "Finished in #{distance_of_time(ms)}"
end
finish_setup(importer, ms) click to toggle source
# File lib/abstract_importer/reporters/progress_reporter.rb, line 7
def finish_setup(importer, ms)
  total = importer.collections.reduce(0) do |total, collection|
    total + importer.count_collection(collection)
  end
  @pbar = ProgressBar.new("progress", total)
end
record_created(record) click to toggle source
# File lib/abstract_importer/reporters/progress_reporter.rb, line 25
def record_created(record)
  pbar.inc
end
record_failed(record, hash) click to toggle source
# File lib/abstract_importer/reporters/progress_reporter.rb, line 29
def record_failed(record, hash)
  pbar.inc
end
record_skipped(hash) click to toggle source
# File lib/abstract_importer/reporters/progress_reporter.rb, line 33
def record_skipped(hash)
  pbar.inc
end
start_collection(collection) click to toggle source
# File lib/abstract_importer/reporters/progress_reporter.rb, line 19
def start_collection(collection)
  # Say nothing
end