dmp-dynamo_adapter 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41ac93e31c250106a76873be5e069337fe772387bef81350afdffe231a09ad80
4
- data.tar.gz: 9998934e79fbdb99639088e64bea3b6a3b516df5b20db4ce8733e7c5bcc7c10c
3
+ metadata.gz: 1fde969438aa9681c5213d60e441b3187de1ed2141c7b244419ba47a007d39fc
4
+ data.tar.gz: a4a9722f607edf91644043c4adbcb3af7bfe81f33d254da104a0223a27fd6c40
5
5
  SHA512:
6
- metadata.gz: 9bdd9d6d4ab79239ca07993ebcb991f3d9298ce01f21058a841921970646b8f08b33ee5239338b95626ca37e19f1272b37da3706425fd985b7a17f2db67fa205
7
- data.tar.gz: 7d374a240cac71d3cd65d1422fbb983e1b4e10f6d8e1096ad9a4ed973d521229a9bf078db1c7a86e8862c3ad596f95e7f4899e9c0e11751339691e1006cd3dbd
6
+ metadata.gz: 0ba67f79d6cdf0b4d29f416301e88b8b4453f85b7381a82280f5389dde4c12bb5446e59bdd21290d04203dbcdaefc73f08c1bd8ffd5221b945a19e514e4f1c2b
7
+ data.tar.gz: 8c2a12ccd6b1049a12f254a6ae5f634c63aa2c3b82870778fd541482d6888cd720426ac6cb213d72b6fb3605ad38a3b948abf7393f63b90cc3898fa72f60966e
@@ -13,27 +13,6 @@ module Dmp
13
13
  ENV['DMP_ID_BASE_URL'].end_with?('/') ? ENV['DMP_ID_BASE_URL'] : "#{ENV['DMP_ID_BASE_URL']}/"
14
14
  end
15
15
 
16
- # Preassign a DMP ID that will leater be sent to the DOI minting authority (EZID)
17
- def preregister_dmp_id
18
- dmp_id = ''
19
- counter = 0
20
-
21
- p 'PREREGISTER DMP ID:'
22
-
23
- while dmp_id == '' && counter <= 10
24
- prefix = "#{ENV['DMP_ID_SHOULDER']}.#{SecureRandom.hex(4).upcase}"
25
- result = Dmp::DynamoAdapter.find_by_pk(
26
- p_key: Dmp::MetadataHandler.append_pk_prefix(dmp: dmp_id)
27
- )
28
- dmp_id = prefix unless result[:status] != 404
29
- counter += 1
30
- end
31
- # Something went wrong and it was unable to identify a unique id
32
- return nil if counter >= 10
33
-
34
- "#{Dmp::MetadataHandler::PK_DMP_PREFIX}#{dmp_id_base_url}#{dmp_id}"
35
- end
36
-
37
16
  # Format the DMP ID in the way we want it
38
17
  def format_dmp_id(value:)
39
18
  dmp_id = value.match(DOI_REGEX).to_s
@@ -304,7 +304,7 @@ p 'PREREGISTER DMP ID:'
304
304
  # Something went wrong and it was unable to identify a unique id
305
305
  return nil if counter >= 10
306
306
 
307
- "#{Dmp::MetadataHandler::PK_DMP_PREFIX}#{dmp_id_base_url}#{dmp_id}"
307
+ "#{Dmp::MetadataHandler::PK_DMP_PREFIX}#{Dmp::DmpIdHandler.dmp_id_base_url}#{dmp_id}"
308
308
  end
309
309
 
310
310
  # Convert the latest version into a historical version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmp-dynamo_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - briri