uc3-dmp-citation 0.0.13 → 0.0.15
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-citation/version.rb +1 -1
- data/lib/uc3-dmp-citation.rb +8 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b85070e81998508a3c313105c19a0b9278cf216ef63244c66a170b43768f893f
|
4
|
+
data.tar.gz: 17cede8c1625c1d5cf410e66da106275f860773b6f7bff05eef34218c0ccfe04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10cef531b7850fe4b3780545da0abf473b7558e606c8b3ac06d6d8f32f82ac9bf32c1f616c4672c2ab206163cabe6b7da4881f9b56e57ca08e45422cc6687666
|
7
|
+
data.tar.gz: 1ecc54d76b5eb89a1baea752ad7b54d5af01bb0667c4d52ec567a9cb50954f1940568ff269f5b54c0589ace8e7286ff03e298fae1b9cae2f6eec418a2b1c8d6f
|
data/lib/uc3-dmp-citation.rb
CHANGED
@@ -28,9 +28,14 @@ module Uc3DmpCitation
|
|
28
28
|
return nil if uri.nil? || uri.blank?
|
29
29
|
|
30
30
|
headers = { Accept: 'application/x-bibtex' }
|
31
|
-
logger
|
32
|
-
|
33
|
-
|
31
|
+
logger&.debug(message: "Fetching BibTeX from: #{uri}")
|
32
|
+
begin
|
33
|
+
resp = Uc3DmpExternalApi::Client.call(url: uri, method: :get, additional_headers: headers, logger:)
|
34
|
+
rescue Uc3DmpExternalApi::ExternalApiError => e
|
35
|
+
logger&.warn(message: "Failure fetching citation for #{uri} - #{e.message}")
|
36
|
+
return nil
|
37
|
+
end
|
38
|
+
return nil if resp.nil? || resp.to_s.strip.empty? || resp.code
|
34
39
|
|
35
40
|
bibtex_to_citation(uri: uri, bibtex_as_string: resp)
|
36
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-dmp-citation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.5.13
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: DMPTool gem that provides support for fetching BibTex for a DOI and converting
|