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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb61482fd32f0f622a954eaef6b2b8abc82a10f460b3f9c3af05eabfc30a077d
4
- data.tar.gz: 32532cbb14ca2d0af66c133cf5889bc9b33866f8dabf229a45b6f9889aba7450
3
+ metadata.gz: b85070e81998508a3c313105c19a0b9278cf216ef63244c66a170b43768f893f
4
+ data.tar.gz: 17cede8c1625c1d5cf410e66da106275f860773b6f7bff05eef34218c0ccfe04
5
5
  SHA512:
6
- metadata.gz: 82e46c9ad5b3d69feeca4a3af0c0f5846faf5aafe0c9529c68b8a8ea07b7834d21b1663bb739c6e44aae85a85ca2ed7658bf4b68721cdc356bbf6bc80523d60e
7
- data.tar.gz: 5aed7f2e3d412b18cb9e2c81b2006bbab176da2d5a8c9ee0d6a72af1d3dc71264e618de435e6d431fd669fc06a4c7685f9e82d80f53bd4afa142965c34e8bd5a
6
+ metadata.gz: 10cef531b7850fe4b3780545da0abf473b7558e606c8b3ac06d6d8f32f82ac9bf32c1f616c4672c2ab206163cabe6b7da4881f9b56e57ca08e45422cc6687666
7
+ data.tar.gz: 1ecc54d76b5eb89a1baea752ad7b54d5af01bb0667c4d52ec567a9cb50954f1940568ff269f5b54c0589ace8e7286ff03e298fae1b9cae2f6eec418a2b1c8d6f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpCitation
4
- VERSION = '0.0.13'
4
+ VERSION = '0.0.15'
5
5
  end
@@ -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.debug(message: "Fetching BibTeX from: #{uri}") if logger.respond_to?(:debug)
32
- resp = Uc3DmpExternalApi::Client.call(url: uri, method: :get, additional_headers: headers, logger:)
33
- return nil if resp.nil? || resp.to_s.strip.empty?
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.13
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-01-29 00:00:00.000000000 Z
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.4.22
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