uc3-dmp-citation 0.0.6 → 0.0.7

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: 7c2817afd07293e08976bd32fad38b356079ef155ae14f4ebd7fba69110de83a
4
- data.tar.gz: 6b985ed4cdf93d42d5ef1a6304c71c3094077ad4398bab1b853ef62ba07d4d99
3
+ metadata.gz: 4fba55e1ca27042d7a33448e9829858c4db34d47c0b8a02323c42986c8037345
4
+ data.tar.gz: 24e57531e78f64f90530110e3447841cddc4b7bf26b34c456fe322ea48f5e06c
5
5
  SHA512:
6
- metadata.gz: aa6b47581cc57faa4bf79f9e079cf57e24054a58ba324ebff96b19c06d8625b593adbfd60337ed732d162c990ceb7fe581d6953f60d01a897c30c123ee1e7097
7
- data.tar.gz: bd438167069b0f3ce62fc983c26d6ee9207b71a662b06a12ec0c301d49c5a21de87729094d869eb09f83bc689aa7c87ec0f10e2d420268ce365b0bf510287590
6
+ metadata.gz: 13a46d26c8d85ef66f51b0c9927b421b78f6cdb549cf3a85cd71618690fa00c7a549c969909b1fb07bf8097c5775c254d10932a0ad2f928e549f5cdd770643ae
7
+ data.tar.gz: 1ca9cca89feaa398983838379f0bad1fa1bfc10d3b524d7336218f46a9af42a0b7a3b9eb1fe333fffedeac76e8220c33897e86f30d56cf95e9bb4634e78e7d6a
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpCitation
4
- VERSION = '0.0.6'
4
+ VERSION = '0.0.7'
5
5
  end
@@ -32,12 +32,18 @@ module Uc3DmpCitation
32
32
  resp = Uc3DmpExternalApi::Client.call(url: uri, method: :get, additional_headers: headers, logger:)
33
33
  return nil if resp.nil? || resp.to_s.strip.empty?
34
34
 
35
- bibtex = BibTeX.parse(_cleanse_bibtex(text: resp))
35
+ bibtex_to_citation(bibtex_as_string: resp)
36
+ end
37
+ # rubocop:enable Metrics/AbcSize
38
+
39
+ def bibtex_to_citation(bibtex_as_string:)
40
+ return nil unless bibtex_as_string.is_a?(String)
41
+
42
+ bibtex = BibTeX.parse(_cleanse_bibtex(text: bibtex_as_string))
36
43
  work_type = work_type.nil? ? determine_work_type(bibtex:) : work_type
37
44
  style = DEFAULT_CITATION_STYLE if style.nil?
38
45
  _bibtex_to_citation(uri:, work_type:, style:, bibtex:)
39
46
  end
40
- # rubocop:enable Metrics/AbcSize
41
47
 
42
48
  private
43
49
 
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.6
4
+ version: 0.0.7
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-10-04 00:00:00.000000000 Z
11
+ date: 2023-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug