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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3f3549ad23c4656916e7e6daf8f9152eb755d46279b7a3b689a26dd7d02d26b
4
- data.tar.gz: 41a955d7b0e97e1094be9fd9d80b8f7ca45d17b901464aaae6816d09b757aa5a
3
+ metadata.gz: d66a6f468a0f6d8db5ae871ca3981e7eb88e78a31dd4ee3c156532c9afd546fe
4
+ data.tar.gz: 92b20512b11ab92808db115a40b8cf5a1e7c5369d890f591fc4745c73f93c3d7
5
5
  SHA512:
6
- metadata.gz: 2dd968c76f1e6fc0af048385872b93d7b3764b0f11bbfd7925c23233235b61b83a6678daec0544dcf6f0625797733b2de04e98691aff56359228caca849b1269
7
- data.tar.gz: be3757e058012feaa9d9f0e11c0b0a75730031ad80f76793bb6f916247bff4c60f001bec49db41466e9aacc8a3b8dbbfcde303b73e5849855b119413fe202bc4
6
+ metadata.gz: 858aaabd9f1cf699257b076309851ea26a44a8262bddd0ad0c99956f2c872ba6a7a705c8edd45cadd45b64097caa8ad9a16b9caa896490e2a2f23622664a4986
7
+ data.tar.gz: 37b83f9bd35d43285879c57d59af76b836ad49c5fc6708c81c34d04685db3238bac1f8e4a80abfbbdc992b7c67560341806c28f80bbfdb696646b4696da89a9d
@@ -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', '').start_with?('http')
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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.12'
4
+ VERSION = '0.1.13'
5
5
  end
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.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley