lib/ddr/ingesttools/ddr_rdr_migrator/migrator.rb in ddr-ingesttools-0.5.0 vs lib/ddr/ingesttools/ddr_rdr_migrator/migrator.rb in ddr-ingesttools-0.6.0
- old
+ new
@@ -1,15 +1,16 @@
module Ddr::IngestTools::DdrRdrMigrator
class Migrator
- attr_reader :files, :logger, :metadata, :outfile
+ attr_reader :checksum_file, :files, :logger, :metadata_file, :outfile
attr_writer :manifest
- def initialize(files:, logger: nil, metadata:, outfile:)
+ def initialize(checksum_file:, files:, logger: nil, metadata_file:, outfile:)
+ @checksum_file = checksum_file
@files = files
@logger = logger || Logger.new(STDOUT)
- @metadata = metadata
+ @metadata_file = metadata_file
@outfile = outfile
end
def call
sort_manifest
@@ -23,11 +24,11 @@
end
private
def manifest
- @manifest ||= as_csv_table(metadata)
+ @manifest ||= as_csv_table(metadata_file)
end
def sort_manifest
sorted = manifest.sort_by { |row| [ row['model'], row['pid'] ] }
self.manifest = CSV::Table.new(sorted)
@@ -64,10 +65,10 @@
def column_remover
ColumnRemover.new(logger: logger, manifest: manifest)
end
def file_path_adder
- FilePathAdder.new(files: files, logger: logger, manifest: manifest)
+ FilePathAdder.new(checksum_file: checksum_file, files: files, logger: logger, manifest: manifest)
end
def license_mapper
LicenseMapper.new(logger: logger, manifest: manifest)
end