uc3-dmp-id 0.0.125 → 0.0.126

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: 73d2494e92230d95b9af70786a5d86c630d5b2173a6e33d61fe709a038324787
4
+ data.tar.gz: 3bb154b98d213aa867ae91a94a4931773faa01131e14a13dcdcdfc50c4d75e6c
5
5
  SHA512:
6
- metadata.gz: 5351fa63c776508d030f46593cd213f8d9eaa52041c4a0c7aee2fdb1709c1b1ab0139676128041e94d43a927cb9e9d31157181bfe08dab00afb274c279636773
7
- data.tar.gz: 755d4ef03a201992cccb0d7276b01b17d279062ab912b841fca0420f83d10048066533b48c76ad0d5478c72418e1b19085a18289775d45b98ce340e69376de16
6
+ metadata.gz: d7e8cff85f91ba62b56063d1351632f39a0088ba14a7a9565c6dcd19784b3c091a2332cbc578e4805065bd70fc1a807099bb70d46b2844e3f5e14d7f18abeb5b
7
+ data.tar.gz: 91811d73974c7664b6008824c4f5b7bc7a5d9414d750dfa6de29ee990c9d292b1b237735d7e38b33e1b5c81fdb52eb7ef0f0245d7bc1b141c4fb760180bf0621
@@ -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 = ''
@@ -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.126'
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.126
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