uc3-dmp-citation 0.0.8 → 0.0.10
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 +4 -3
- 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: a11a8cb9c089fbe07b7e25626be89f35de2cb60635a4f06aa4e6a727f636974a
|
4
|
+
data.tar.gz: 26d2eb8ddc597a65208428fb439957e231ad9b21eb7a69bcf6154470c6c3c3be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '068f06d2f99046f61eb877e63d3be5a050feac6a15041dfdcff3aed94e12ef1baa92c09f0aeb6dc5b6bc7da583a174d71006da9893cdf32038b227df3c9c206a'
|
7
|
+
data.tar.gz: 6ac0f00459c97020d598380e576b0bd4d103baf94cea95b3dd650a87a1cf780bb0477bf6f996c8eb14994bd079944ccf83ae4fb548561da7ce321c42db7b43ff
|
data/lib/uc3-dmp-citation.rb
CHANGED
@@ -36,11 +36,12 @@ module Uc3DmpCitation
|
|
36
36
|
end
|
37
37
|
# rubocop:enable Metrics/AbcSize
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
# Convert the specified BibTex string into a citation
|
40
|
+
def bibtex_to_citation(uri:, bibtex_as_string:)
|
41
|
+
return nil unless bibtex_as_string.is_a?(String) && uri.is_a?(String)
|
41
42
|
|
42
43
|
bibtex = BibTeX.parse(_cleanse_bibtex(text: bibtex_as_string))
|
43
|
-
work_type = work_type.nil? ?
|
44
|
+
work_type = work_type.nil? ? _determine_work_type(bibtex:) : work_type
|
44
45
|
style = DEFAULT_CITATION_STYLE if style.nil?
|
45
46
|
_bibtex_to_citation(uri:, work_type:, style:, bibtex:)
|
46
47
|
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.10
|
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-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|