From d40e8b78cbc14ce52f63a074a08642b8d637dc45 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 13 Jul 2020 08:47:29 +0200 Subject: [PATCH] don't allow doi as alternate identifier --- Gemfile.lock | 2 +- lib/bolognese/datacite_utils.rb | 5 +++-- lib/bolognese/version.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c1bf7149..30282513 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - bolognese (1.7.2) + bolognese (1.7.3) activesupport (>= 4.2.5) benchmark_methods (~> 0.7) bibtex-ruby (>= 5.1.0) diff --git a/lib/bolognese/datacite_utils.rb b/lib/bolognese/datacite_utils.rb index 6d3f1257..0cdd0ab9 100644 --- a/lib/bolognese/datacite_utils.rb +++ b/lib/bolognese/datacite_utils.rb @@ -116,10 +116,11 @@ def insert_resource_type(xml) end def insert_alternate_identifiers(xml) - return xml unless identifiers.present? + alternate_identifiers = Array.wrap(identifiers).select { |r| r["identifierType"] != "DOI" } + return xml unless alternate_identifiers.present? xml.alternateIdentifiers do - Array.wrap(identifiers).each do |alternate_identifier| + Array.wrap(alternate_identifiers).each do |alternate_identifier| xml.alternateIdentifier(alternate_identifier["identifier"], 'alternateIdentifierType' => alternate_identifier["identifierType"]) end end diff --git a/lib/bolognese/version.rb b/lib/bolognese/version.rb index 5bd0c4b4..0c42d3f1 100644 --- a/lib/bolognese/version.rb +++ b/lib/bolognese/version.rb @@ -1,3 +1,3 @@ module Bolognese - VERSION = "1.7.2" + VERSION = "1.7.3" end