uc3-dmp-citation 0.0.6 → 0.0.8
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 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67a332e53500ff2bcedaa01ba62b35d80e858216621eed9f274132185cbb26a9
|
4
|
+
data.tar.gz: 8bbfae020d9a4641a7369cf82adb1748d20561b5e23d5817e66c5f435e361314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04c26a5fe55c85d3859351489365235a7bb8633cbacf3f5ae72f0c024ce8ee2aa863d62adb52934169f420d3adcdcadd734bfdaf9233d362845df1f0e5e9a89
|
7
|
+
data.tar.gz: 99664e3232b91adb6fa6759c648acb2c0300c758dfffba88ee6124dd95dc4f8c18148445996ab47497effafc640013059a71784e067e5b9683ecf4feb98821ce
|
data/lib/uc3-dmp-citation.rb
CHANGED
@@ -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
|
-
|
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.
|
4
|
+
version: 0.0.8
|
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-
|
11
|
+
date: 2023-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|