Sha256: 2417e375f700037b1344226cb8c92d74a67cf81ad8a6ca4bf51b954d1fb00b8d
Contents?: true
Size: 787 Bytes
Versions: 11
Compression:
Stored size: 787 Bytes
Contents
# frozen_string_literal: true module Bulkrax class CsvFileSetEntry < CsvEntry def factory_class ::FileSet end def add_path_to_file parsed_metadata['file'].each_with_index do |filename, i| path_to_file = ::File.join(parser.path_to_files, filename) parsed_metadata['file'][i] = path_to_file end raise ::StandardError, "one or more file paths are invalid: #{parsed_metadata['file'].join(', ')}" unless parsed_metadata['file'].map { |file_path| ::File.file?(file_path) }.all? parsed_metadata['file'] end def validate_presence_of_parent! return if parsed_metadata[related_parents_parsed_mapping]&.map(&:present?)&.any? raise StandardError, 'File set must be related to at least one work' end end end
Version data entries
11 entries across 11 versions & 1 rubygems