uc3-dmp-id 0.1.56 → 0.1.58
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/finder.rb +5 -5
- data/lib/uc3-dmp-id/version.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: '0987f59845998c2a2e3409986fe93f8b176f0f3ad175f2b25384fd1c558dd943'
|
4
|
+
data.tar.gz: 7ee6181e791f32a788c96e4f5c4a174cb510f7b89a99d2bd0dc4e575e457efe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a66993ced9e0c61fac91fb754f90f637c7eaf630c8751b3dd2ee7b4b396f3741e71ec48fd64e387c508cc68b2bcad4f9cf89dda747a56b2d0eb2fb42720a6c30
|
7
|
+
data.tar.gz: 42ca4b60f5e094acd492257dd97da3fc1191912c9f1dbad4fbbe614c7ad34ea02db617ea1e9501e02ede5a5a4e4493d5e7041d365bceff6bbc7f6d604cf34ad9
|
data/lib/uc3-dmp-id/finder.rb
CHANGED
@@ -135,9 +135,9 @@ module Uc3DmpId
|
|
135
135
|
def _by_owner(owner:, client: nil, logger: nil)
|
136
136
|
orcid_regex = /^([0-9A-Z]{4}-){3}[0-9A-Z]{4}$/
|
137
137
|
email_regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
138
|
-
email = owner.
|
138
|
+
email = owner.strip unless (owner.to_s.strip.gsub('%40', '@') =~ email_regex).nil?
|
139
139
|
|
140
|
-
if !(owner.to_s.
|
140
|
+
if !(owner.to_s.strip =~ orcid_regex).nil?
|
141
141
|
args = {
|
142
142
|
filter_expression: 'contains(:people_ids, people) AND :sk = sk',
|
143
143
|
expression_attribute_values: {
|
@@ -151,7 +151,7 @@ module Uc3DmpId
|
|
151
151
|
elsif !email.nil?
|
152
152
|
args = {
|
153
153
|
filter_expression: 'contains(:people, people) AND :sk = sk',
|
154
|
-
expression_attribute_values: { ':sk': 'METADATA', ':people': [email] }
|
154
|
+
expression_attribute_values: { ':sk': 'METADATA', ':people': [email.gsub('%40', '@')] }
|
155
155
|
}
|
156
156
|
else
|
157
157
|
# It wasn't an email or ORCID, so return an empty array
|
@@ -165,7 +165,7 @@ module Uc3DmpId
|
|
165
165
|
# Fetch the DMP IDs for the specified organization/institution
|
166
166
|
def _by_org(org:, client: nil, logger: nil)
|
167
167
|
regex = /^[a-zA-Z0-9]+$/
|
168
|
-
ror = org.
|
168
|
+
ror = org.strip unless (org.to_s =~ regex).nil?
|
169
169
|
|
170
170
|
args = {
|
171
171
|
filter_expression: 'contains(:affiliation_ids, affiliation_ids) AND :sk = sk',
|
@@ -185,7 +185,7 @@ module Uc3DmpId
|
|
185
185
|
# Fetch the DMP IDs for the specified funder
|
186
186
|
def _by_funder(funder:, client: nil, logger: nil)
|
187
187
|
regex = /^[a-zA-Z0-9]+$/
|
188
|
-
ror = funder.
|
188
|
+
ror = funder.strip unless (funder.to_s =~ regex).nil?
|
189
189
|
|
190
190
|
args = {
|
191
191
|
filter_expression: 'contains(:funder_ids, funder_ids) AND :sk = sk',
|
data/lib/uc3-dmp-id/version.rb
CHANGED