uc3-dmp-id 0.0.125 → 0.0.127

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: 925f59292b99ac41d21ff702d51d5dde21b915aa3c5d285f39b162422fa15826
4
- data.tar.gz: 970ce77358af939143f9e8d2e06167ec64127a9fec42daed5acbb5f84e523c34
3
+ metadata.gz: 505619f9a95410b5398d081efe3f01b98b34a438d5bcfc74403e06b9ea3d1b8a
4
+ data.tar.gz: 957721679c8a517c6210c2f98cf8002e887c06e1288d2f07bf7523183e78fd86
5
5
  SHA512:
6
- metadata.gz: 5351fa63c776508d030f46593cd213f8d9eaa52041c4a0c7aee2fdb1709c1b1ab0139676128041e94d43a927cb9e9d31157181bfe08dab00afb274c279636773
7
- data.tar.gz: 755d4ef03a201992cccb0d7276b01b17d279062ab912b841fca0420f83d10048066533b48c76ad0d5478c72418e1b19085a18289775d45b98ce340e69376de16
6
+ metadata.gz: f44775e67e24a75d165a8b6ed32f22354fb1cae956cdd1ab49296f00d83a40a2a41dcb11e7c10de3c686c475265b162763fe09c18ac44e8522488deb79b3fe4e
7
+ data.tar.gz: c9857691517801a6985826f7816cad3afad3e08c0579c129d310aa43ed1a72c1bc3dc7b6f519f69986ec0c00b664cdb58a8d4f469c7f0ae88f47058ef9ca983d
@@ -58,13 +58,12 @@ module Uc3DmpId
58
58
 
59
59
  def _preregister_dmp_id(client:, provenance:, json:, logger: nil)
60
60
  # Use the specified DMP ID if the provenance has permission
61
- existing = json.fetch('dmp', {}).fetch('dmp_id', {})
61
+ seeding = provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true'
62
62
  seed_id = json.fetch('dmp', {})['dmproadmap_external_system_identifier']
63
63
 
64
64
  # If we are seeding already registered DMP IDs from the Provenance system, then return the original DMP ID
65
- return seed_id.gsub(%r{https?://}, '') if %w['doi', 'url'].include?(existing.fetch('type', 'other')) &&
66
- !seed_id.nil? &&
67
- provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true'
65
+ logger.debug(message: "Seeding DMP ID with #{seed_id.gsub(%r{https?://}, '')}") if seeding && !seed_id.nil?
66
+ return seed_id.gsub(%r{https?://}, '') if seeding && !seed_id.nil?
68
67
 
69
68
  #Generate a new DMP ID
70
69
  dmp_id = ''
@@ -294,6 +294,7 @@ module Uc3DmpId
294
294
  "type": "string",
295
295
  "title": "The Funding Grant ID Type Schema",
296
296
  "enum": [
297
+ "doi",
297
298
  "url",
298
299
  "other"
299
300
  ],
@@ -1312,6 +1312,7 @@ module Uc3DmpId
1312
1312
  "type": "string",
1313
1313
  "title": "The Funding Grant ID Type Schema",
1314
1314
  "enum": [
1315
+ "doi",
1315
1316
  "url",
1316
1317
  "other"
1317
1318
  ],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.125'
4
+ VERSION = '0.0.127'
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.125
4
+ version: 0.0.127
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-08-04 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json