uc3-dmp-id 0.0.72 → 0.0.74

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d6c9c1bda7d28c8edac4bbf404893ef184ca68b7158a0a047bfbfbcab67c49a
4
- data.tar.gz: 37c9807b5b5af8c767aba6a73f73766d04eebddc5eb5955d6c37758be08cd941
3
+ metadata.gz: aafd3e027681cfa713fad3c48471dae7a192cd844546e67a55cec59ae0c2e1d8
4
+ data.tar.gz: deda47068b080ccbfddd35091cde8626bde787110ae5a4df6bb204f0b248ff89
5
5
  SHA512:
6
- metadata.gz: 4f45ce1f5588c1f2a293b9c0a3ad6c8916bef9c51e28762b7342488cd4b9687b5687d5fbc570e552b4c79e6e0e68089aceb9e543ae074a419d29fc07d9a2cc35
7
- data.tar.gz: 105f77683115f91bbb7427f96eb226b483ea054172c0bde0717339b2b7c2e0f02d2089105223ad255448045f22372d5c8a0563030b943a0517684f0763626b12
6
+ metadata.gz: 578c94e8fc0da1b8bb36b163eca0cdd656fc1ae63cbdb02f4be104a6746d137f83b5dc6cd36424549c8f227eba20b69f7058710fb188a400fa546db28a52e08a
7
+ data.tar.gz: fc2e39ea16382559b2eac7459528e7cf241623dd9256497088f4c000819dda5d491a80a7f555ed6e357a510d85228884aa842c38b5175e64c15c0666dfb2df26
@@ -54,13 +54,14 @@ module Uc3DmpId
54
54
  def _preregister_dmp_id(client:, provenance:, json:, debug: false)
55
55
  # Use the specified DMP ID if the provenance has permission
56
56
  existing = json.fetch('dmp', {}).fetch('dmp_id', {})
57
- id = existing['identifier'].gsub(%r{https?://}, Helper::PK_DMP_PREFIX) if existing.is_a?(Hash) &&
58
- !existing['identifier'].nil?
59
- return id if !id.nil? &&
60
- existing.fetch('type', 'other').to_s.downcase == 'doi' &&
61
- provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true' &&
62
- !Finder.exists?(client: client, p_key: id)
57
+ seed_id = json.fetch('dmp', {})['dmproadmap_external_system_identifier']
63
58
 
59
+ # If we are seeding already registered DMP IDs from the Provenance system, then return the original DMP ID
60
+ return seed_id.gsub(%r{https?://}, '') if existing.fetch('type', 'other') == 'url' &&
61
+ !seed_id.nil? &&
62
+ provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true'
63
+
64
+ #Generate a new DMP ID
64
65
  dmp_id = ''
65
66
  counter = 0
66
67
  while dmp_id == '' && counter <= 10
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.72'
4
+ VERSION = '0.0.74'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.72
4
+ version: 0.0.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-30 00:00:00.000000000 Z
11
+ date: 2023-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json