uc3-dmp-citation 0.0.14 → 0.0.16
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 +7 -2
- 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: d8f6ce6b1e876be86359025dc20ed5f0cb61ce24414c3976f6cfe6cf1ea64a48
|
4
|
+
data.tar.gz: 8db13b8bed6167b3c888945d59ec0e23a2a47668001f867082b453f859ad1c60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deba715a7e4a87f9499d0a5e37357ddda9992b50f5037efbd344b5fc3dcacd7ab3ca2b8a49fd4ff0c8e5d0f5f82d261b3ecc903d8f8f1aff622e9ad05f818806
|
7
|
+
data.tar.gz: c9acc90c6ea97c091fc4595bc004e18148075d6c3b3d8193e5f4c942434a76dfe8d728cf26c75940234dc4aa0e0010d9bcf91ccd56a2365d0e3efc6bed7fc90e
|
data/lib/uc3-dmp-citation.rb
CHANGED
@@ -28,8 +28,13 @@ module Uc3DmpCitation
|
|
28
28
|
return nil if uri.nil? || uri.blank?
|
29
29
|
|
30
30
|
headers = { Accept: 'application/x-bibtex' }
|
31
|
-
logger
|
32
|
-
|
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
|
33
38
|
return nil if resp.nil? || resp.to_s.strip.empty?
|
34
39
|
|
35
40
|
bibtex_to_citation(uri: uri, bibtex_as_string: resp)
|
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.16
|
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-05
|
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
|