uc3-dmp-id 0.0.90 → 0.0.91
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/deleter.rb +2 -4
- data/lib/uc3-dmp-id/finder.rb +3 -3
- 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 +0 -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: 8fc2f1105b9026517773a3df7165cf35d1e346f35abe5e1250390328ebdb8dcc
|
4
|
+
data.tar.gz: 6ebf56cfed68d53f67e1b272c0f9eec2db1fe027d773388ddc9705e277435e1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6754ec2264db1e2b993c5cf5289a13b48c888587a5c2df2f5ad64521ffeba1b13c71916e5feea230bf0fc75dab3c79a47e75fe92101c885afa572529866834a2
|
7
|
+
data.tar.gz: aac5e6524c66cee7f18cfe9f4fe90d44cdfbdedc530c1a7318140929bf5ad59f07645a3d9b016fef54d133ee1f7ac17937479c5edf74164781cde3dba52047ed
|
data/lib/uc3-dmp-id/deleter.rb
CHANGED
@@ -38,16 +38,14 @@ module Uc3DmpId
|
|
38
38
|
# Delete the Latest version
|
39
39
|
resp = client.delete_item(p_key: p_key, s_key: Helper::SK_DMP_PREFIX, logger: logger)
|
40
40
|
|
41
|
-
# TODO: We should do a check here to see if it was successful!
|
42
|
-
puts resp.inspect
|
41
|
+
# TODO: We should do a check here to see if it was successful!
|
43
42
|
|
44
43
|
# Notify EZID about the removal
|
45
44
|
_post_process(json: dmp, logger: logger)
|
46
45
|
# Return the tombstoned record
|
47
46
|
Helper.cleanse_dmp_json(json: JSON.parse({ dmp: dmp }.to_json))
|
48
47
|
rescue Aws::Errors::ServiceError => e
|
49
|
-
|
50
|
-
puts e.backtrace
|
48
|
+
logger.error(message: e.message, details: e.backtrace) unless logger.nil?
|
51
49
|
{ status: 500, error: Messages::MSG_SERVER_ERROR }
|
52
50
|
end
|
53
51
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
data/lib/uc3-dmp-id/finder.rb
CHANGED
@@ -135,7 +135,7 @@ module Uc3DmpId
|
|
135
135
|
filter_expression: 'SK = :version',
|
136
136
|
expression_attribute_values: { ':version': Helper::DMP_LATEST_VERSION }
|
137
137
|
}
|
138
|
-
|
138
|
+
logger.info(message: "Querying _by_owner with #{args}") unless logger.nil?
|
139
139
|
client = client.nil? ? Uc3DmpDynamo::Client.new : client
|
140
140
|
_process_search_response(response: client.query(args: args, logger: logger))
|
141
141
|
end
|
@@ -159,7 +159,7 @@ module Uc3DmpId
|
|
159
159
|
filter_expression: 'SK = :version',
|
160
160
|
expression_attribute_values: { ':version': Helper::DMP_LATEST_VERSION }
|
161
161
|
}
|
162
|
-
|
162
|
+
logger.info(message: "Querying _by_owner_org with #{args}") unless logger.nil?
|
163
163
|
client = client.nil? ? Uc3DmpDynamo::Client.new : client
|
164
164
|
_process_search_response(response: client.query(args: args, logger: logger))
|
165
165
|
end
|
@@ -180,7 +180,7 @@ module Uc3DmpId
|
|
180
180
|
filter_expression: 'SK = :version',
|
181
181
|
expression_attribute_values: { ':version': Helper::DMP_LATEST_VERSION }
|
182
182
|
}
|
183
|
-
|
183
|
+
logger.info(message: "Querying _by_mod_day with #{args}") unless logger.nil?
|
184
184
|
client = client.nil? ? Uc3DmpDynamo::Client.new : client
|
185
185
|
_process_search_response(response: client.query(args: args, logger: logger))
|
186
186
|
end
|
data/lib/uc3-dmp-id/validator.rb
CHANGED
@@ -45,7 +45,7 @@ module Uc3DmpId
|
|
45
45
|
# ------------------------------------------------------------------------------------
|
46
46
|
def _load_schema(mode:)
|
47
47
|
# Instatiate the matching schema
|
48
|
-
schema = "Uc3DmpId::Schemas::#{mode.to_s.downcase.capitalize}".split('::').inject(Object) { |o,c|
|
48
|
+
schema = "Uc3DmpId::Schemas::#{mode.to_s.downcase.capitalize}".split('::').inject(Object) { |o,c| o.const_get c }
|
49
49
|
schema.respond_to?(:load) ? schema.load : nil
|
50
50
|
end
|
51
51
|
|
data/lib/uc3-dmp-id/version.rb
CHANGED
data/lib/uc3-dmp-id/versioner.rb
CHANGED
@@ -111,7 +111,6 @@ module Uc3DmpId
|
|
111
111
|
resp = client.put_item(json: latest_version, logger: logger)
|
112
112
|
return nil if resp.nil?
|
113
113
|
|
114
|
-
puts "Created new version #{latest_version['PK']} - #{latest_version['SK']}" if debug
|
115
114
|
msg = "#{SOURCE} created version PK: #{latest_version['PK']} SK: #{latest_version['SK']}"
|
116
115
|
logger.info(message: msg, details: latest_version) if logger.respond_to?(:debug)
|
117
116
|
latest_version
|