From 1d38d74cbbdda2110f2ba938fb57f13eaf9972f5 Mon Sep 17 00:00:00 2001 From: mnyrop Date: Thu, 9 Nov 2023 17:40:30 -0500 Subject: [PATCH] prune present? and blank? commands --- aperitiiif.gemspec | 2 +- lib/aperitiiif/batch.rb | 2 +- lib/aperitiiif/batch/records.rb | 2 +- lib/aperitiiif/item.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aperitiiif.gemspec b/aperitiiif.gemspec index 494b10e..ca3a3ad 100644 --- a/aperitiiif.gemspec +++ b/aperitiiif.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_dependency 'colorize' - spec.add_dependency 'iiif-presentation' + spec.add_dependency 'iiif-presentation', '1.1' spec.add_dependency 'liquid' spec.add_dependency 'mimemagic' spec.add_dependency 'parallel' diff --git a/lib/aperitiiif/batch.rb b/lib/aperitiiif/batch.rb index 9c6ccf5..0374aa4 100644 --- a/lib/aperitiiif/batch.rb +++ b/lib/aperitiiif/batch.rb @@ -64,7 +64,7 @@ def seed 'label' => config.label, 'description' => config.batch_description, 'attribution' => config.batch_attribution - }.delete_if { |_key, val| val.blank? } + }.delete_if { |_key, val| val.to_s.empty? } end def iiif_collection diff --git a/lib/aperitiiif/batch/records.rb b/lib/aperitiiif/batch/records.rb index ac780df..cf9decb 100644 --- a/lib/aperitiiif/batch/records.rb +++ b/lib/aperitiiif/batch/records.rb @@ -37,7 +37,7 @@ def records_file_exists?(file = config.records_file) def load_records! self.items = items.map do |item| record = find_record(item.id, records) - item.record = record if record.present? + item.record = record unless record.to_s.empty? item end end diff --git a/lib/aperitiiif/item.rb b/lib/aperitiiif/item.rb index 85662bf..60b768c 100644 --- a/lib/aperitiiif/item.rb +++ b/lib/aperitiiif/item.rb @@ -67,7 +67,7 @@ def seed 'description' => record.description, 'source' => record.source, 'metadata' => record.custom_metadata - }.delete_if { |_key, val| val.blank? } + }.delete_if { |_key, val| val.to_s.empty? } end def build_manifest