uc3-dmp-id 0.0.5 → 0.0.7

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: fb6a21e1fcad936e84cad2d4067084a823104c99d68c4acf037a623c01fcf55e
4
- data.tar.gz: 01256a0949cc0625912d4c86309375f4c9abfd4ff9d3b5c6f713c798d70161ac
3
+ metadata.gz: 8b5c0aa471073de5389e6c43c002e0d755770a92e843c1c14dd79de9282076ef
4
+ data.tar.gz: 8eb5f9aad1727ddc546d3f93464feef2a1052bf8f4baa470601eb24ce12536f0
5
5
  SHA512:
6
- metadata.gz: b7fec6aaddcd4f9d8029731c37a0363e55a1a66679a0359c07662c1f12fdc1d213695fa5a67f4c25e5a0fb059cd9cd3b195f7c7fd14beb771bf23a2f4fd1f19f
7
- data.tar.gz: 51e8b4a4d987673b551a3b53b435ec057f61f1b43e10d6829a26977d1c7af1d1db3d7ea1ed61f140903288fc9b766841ebfb30ed4b2ed7244ed2caad3b4269c8
6
+ metadata.gz: 3a0eb1bea68002ba01b1c1d8f857d89fbff26cd058ffab31379bbc28e5c237c5b530dfbbfc9d3d8eb1a106e306b74a7c394d10b6dd2f261f2ae6d996e9d8794c
7
+ data.tar.gz: 33a52715b9fcfa8564b6f3e44245013918e26b8fae8af771cddbe96e47c771168884a5bc74cd2ef95baa1bf4404eaa1fb4540dcc850bb741dd04b491ec9a39f4
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- class Uc3DmpIdCreatorError << StandardError; end
4
+ class Uc3DmpIdCreatorError < StandardError; end
5
5
 
6
6
  class Creator
7
7
  class << self
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- class Uc3DmpIdDeleterError << StandardError; end
4
+ class Uc3DmpIdDeleterError < StandardError; end
5
5
 
6
6
  class Deleter
7
7
  class << self
@@ -3,7 +3,7 @@
3
3
  require 'uc3-dmp-dynamo'
4
4
 
5
5
  module Uc3DmpId
6
- class Uc3DmpIdFinderError << StandardError; end
6
+ class Uc3DmpIdFinderError < StandardError; end
7
7
 
8
8
  # Methods to find/search for DMP IDs
9
9
  class Finder
@@ -22,6 +22,30 @@ module Uc3DmpId
22
22
  DMP_TOMBSTONE_VERSION = "#{SK_DMP_PREFIX}tombstone"
23
23
 
24
24
  class << self
25
+ # Append the PK prefix for the object
26
+ # -------------------------------------------------------------------------------------
27
+ def append_pk_prefix(p_key:)
28
+ p_key.is_a?(String) ? "#{PK_DMP_PREFIX}#{remove_pk_prefix(p_key: p_key)}" : nil
29
+ end
30
+
31
+ # Strip off the PK prefix
32
+ # -------------------------------------------------------------------------------------
33
+ def remove_pk_prefix(p_key:)
34
+ p_key.is_a?(String) ? p_key.gsub(PK_DMP_PREFIX, '') : p_key
35
+ end
36
+
37
+ # Append the SK prefix for the object
38
+ # -------------------------------------------------------------------------------------
39
+ def append_sk_prefix(s_key:)
40
+ s_key.is_a?(String) ? "#{SK_DMP_PREFIX}#{remove_pk_prefix(s_key: s_key)}" : nil
41
+ end
42
+
43
+ # Strip off the SK prefix
44
+ # -------------------------------------------------------------------------------------
45
+ def remove_sk_prefix(s_key:)
46
+ s_key.is_a?(String) ? s_key.gsub(SK_DMP_PREFIX, '') : s_key
47
+ end
48
+
25
49
  # Return the base URL for a DMP ID
26
50
  def dmp_id_base_url
27
51
  url = ENV.fetch('DMP_ID_BASE_URL', 'https://dmptool-dev.cdlib.org/dmps/')
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- class Uc3DmpIdUpdaterError << StandardError; end
4
+ class Uc3DmpIdUpdaterError < StandardError; end
5
5
 
6
6
  class Updater
7
7
  class << self
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- class Uc3DmpIdValidatorError << StandardError; end
4
+ class Uc3DmpIdValidatorError < StandardError; end
5
5
 
6
6
  class Validator
7
7
  # Valid Validation modes are:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.7'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- class Uc3DmpIdVersionerError << StandardError; end
4
+ class Uc3DmpIdVersionerError < StandardError; end
5
5
 
6
6
  class Versioner
7
7
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley