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 +4 -4
- data/lib/uc3-dmp-id/creator.rb +1 -1
- data/lib/uc3-dmp-id/deleter.rb +1 -1
- data/lib/uc3-dmp-id/finder.rb +1 -1
- data/lib/uc3-dmp-id/helper.rb +24 -0
- data/lib/uc3-dmp-id/updater.rb +1 -1
- data/lib/uc3-dmp-id/validator.rb +1 -1
- data/lib/uc3-dmp-id/version.rb +1 -1
- data/lib/uc3-dmp-id/versioner.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b5c0aa471073de5389e6c43c002e0d755770a92e843c1c14dd79de9282076ef
|
4
|
+
data.tar.gz: 8eb5f9aad1727ddc546d3f93464feef2a1052bf8f4baa470601eb24ce12536f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a0eb1bea68002ba01b1c1d8f857d89fbff26cd058ffab31379bbc28e5c237c5b530dfbbfc9d3d8eb1a106e306b74a7c394d10b6dd2f261f2ae6d996e9d8794c
|
7
|
+
data.tar.gz: 33a52715b9fcfa8564b6f3e44245013918e26b8fae8af771cddbe96e47c771168884a5bc74cd2ef95baa1bf4404eaa1fb4540dcc850bb741dd04b491ec9a39f4
|
data/lib/uc3-dmp-id/creator.rb
CHANGED
data/lib/uc3-dmp-id/deleter.rb
CHANGED
data/lib/uc3-dmp-id/finder.rb
CHANGED
data/lib/uc3-dmp-id/helper.rb
CHANGED
@@ -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/')
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
data/lib/uc3-dmp-id/validator.rb
CHANGED
data/lib/uc3-dmp-id/version.rb
CHANGED
data/lib/uc3-dmp-id/versioner.rb
CHANGED