uc3-dmp-id 0.1.12 → 0.1.13
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/augmenter.rb +5 -10
- 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: d66a6f468a0f6d8db5ae871ca3981e7eb88e78a31dd4ee3c156532c9afd546fe
|
4
|
+
data.tar.gz: 92b20512b11ab92808db115a40b8cf5a1e7c5369d890f591fc4745c73f93c3d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 858aaabd9f1cf699257b076309851ea26a44a8262bddd0ad0c99956f2c872ba6a7a705c8edd45cadd45b64097caa8ad9a16b9caa896490e2a2f23622664a4986
|
7
|
+
data.tar.gz: 37b83f9bd35d43285879c57d59af76b836ad49c5fc6708c81c34d04685db3238bac1f8e4a80abfbbdc992b7c67560341806c28f80bbfdb696646b4696da89a9d
|
data/lib/uc3-dmp-id/augmenter.rb
CHANGED
@@ -107,7 +107,7 @@ module Uc3DmpId
|
|
107
107
|
return nil unless funding.is_a?(Hash) && (!funding['awardUri'] || !funding['awardNumber'])
|
108
108
|
return nil if @known_awards.include?(funding['awardUri']) || @known_awards.include?(funding['awardNumber'])
|
109
109
|
|
110
|
-
id = funding['awardUri'] if funding.fetch('awardUri', '')
|
110
|
+
id = funding['awardUri'] if funding.fetch('awardUri', '')&.start_with?('http')
|
111
111
|
id = funding['awardNumber'] if id.nil?
|
112
112
|
|
113
113
|
ret = {
|
@@ -116,16 +116,11 @@ module Uc3DmpId
|
|
116
116
|
score: work['score'],
|
117
117
|
notes: work['notes'],
|
118
118
|
name: funding['funderName'],
|
119
|
-
funding_status: 'granted'
|
120
|
-
grant_id: {
|
121
|
-
type: if id.start_with?('http')
|
122
|
-
id.include?('doi') ? 'doi' : 'url'
|
123
|
-
else
|
124
|
-
'other'
|
125
|
-
end,
|
126
|
-
identifier: id
|
127
|
-
}
|
119
|
+
funding_status: id.nil? ? 'planned' : 'granted'
|
128
120
|
}
|
121
|
+
id_type = id.start_with?('http') ? (id.include?('doi') ? 'doi' : 'url') : 'other' unless id.nil?
|
122
|
+
ret[:grant_id] = { type: id_type, identifier: id } unless id.nil?
|
123
|
+
|
129
124
|
funder_id = funding['funderIdentifier']
|
130
125
|
@logger&.debug(message: "Assessing Work: #{work['id']} (pre funder_id)", details: ret)
|
131
126
|
return JSON.parse(ret.to_json) if funder_id.nil?
|
data/lib/uc3-dmp-id/version.rb
CHANGED