uc3-dmp-id 0.1.16 → 0.1.18

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: 645e3c7bb9339eb12533c0fab00686046b0176c3fa71475e2a19435fd7563b19
4
- data.tar.gz: 82b3bfc2d60dae7f154f8fc09f8d5ea5fcf3132ab3049bae6ba817e31922a9d3
3
+ metadata.gz: c1307ce8ca80ee4f57ab605dc5804d2318593c8042b9f59ac9b4907bf370a87b
4
+ data.tar.gz: 00e3ae0ff4a083240274a413c14234e6287f223fa7d936bcc36ad6087a890872
5
5
  SHA512:
6
- metadata.gz: b1d4d719b882f070ae63f4e730c83a838ebca9a9ee5cfbc3c2118412a664c283c50b17d49aec73e9e78d974ce34a9067add4fcdbe44745000de457306c74d2c1
7
- data.tar.gz: 2725feb16c32f277471f495bb14e7ca8649fc9371e75400db2fc47a553a00e89bfd0557b53b03c959ff8938401327369b56754665a5c438f532c20bac65b06b4
6
+ metadata.gz: 958040bdec6799e3b02e02caf399c0135d546fc8c5e8535129bf641970076e1c6524f4bf0c525ff830ec7efe9db905b8abee76db168b6115c4d8f65b9d221ca0
7
+ data.tar.gz: 97091e9049ac3e8dccd069b69d35504a41f1bc24d6295b99054587336bcfc327fe5d9c15a38852f86352fc14edc311169ba026a185395c6af8d1866c884c255b
@@ -55,6 +55,7 @@ module Uc3DmpId
55
55
  mod_hash['funding'] = mod_hash.fetch('funding', []).flatten.compact.uniq
56
56
 
57
57
  # Save the DMP
58
+ @logger.debug(message: 'New mods:', details: mod_hash)
58
59
  @dmp['dmphub_modifications'] = (@known_mods.nil? ? [] : @known_mods) << mod_hash
59
60
  client = Uc3DmpDynamo::Client.new
60
61
  resp = client.put_item(json: @dmp, logger:)
@@ -82,6 +83,7 @@ module Uc3DmpId
82
83
  def _work_to_mod_entry(type:, work:)
83
84
  return nil if work['id'].nil?
84
85
 
86
+ @logger&.debug(message: "Incoming Work:", details: work)
85
87
  ret = {
86
88
  type: 'doi',
87
89
  identifier: work['id'],
@@ -93,8 +95,9 @@ module Uc3DmpId
93
95
  }
94
96
  work_type = work.fetch('type', 'Text')&.downcase&.strip
95
97
  ret[:work_type] = work_type == 'text' ? type : work_type
98
+ ret[:citation] = work['citation'] unless work['citation'].nil?
96
99
  @logger&.debug(message: "Assessing Work: #{work['id']} (pre citation)", details: ret)
97
- return JSON.parse(ret.to_json) if work['bibtex'].nil?
100
+ return JSON.parse(ret.to_json) unless ret[:citation].nil? && !work['bibtex'].nil?
98
101
 
99
102
  ret[:citation] = Uc3DmpCitation::Citer.bibtex_to_citation(uri: work['id'], bibtex_as_string: work['bibtex'])
100
103
  JSON.parse(ret.to_json)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.16'
4
+ VERSION = '0.1.18'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-03 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json