bolognese 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/metadata_utils.rb +11 -1
- data/lib/bolognese/version.rb +1 -1
- data/spec/writers/citation_writer_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5b78dfdbfeebeb8a651ff200fe96c6963ae9d4c97f2e1f789b542b4a6d13aa9
|
4
|
+
data.tar.gz: 1005deaf744a125a7fe74c19bf83d4e28521b2c3e6b87048adda385b05842f21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d56fa5c7a18868fcf008a84c6487a18d66894c9277da0a08c14dd97e12dae5662012e684a0aa485660da9361eb93cf4e78fb0dcccf98438313bad95298a8f93
|
7
|
+
data.tar.gz: 47891db67b0f14b040242dda9c02a9638789a43798e85be18571a83e91903b2f6d2717f3628829734519148089447b5147de04a138568635aeeb2054a1c91452
|
data/Gemfile.lock
CHANGED
@@ -92,6 +92,16 @@ module Bolognese
|
|
92
92
|
@last_page ||= meta.fetch("last_page", nil)
|
93
93
|
end
|
94
94
|
|
95
|
+
def container_title
|
96
|
+
if periodical.present?
|
97
|
+
periodical["title"]
|
98
|
+
elsif types["citeproc"] == "article-journal"
|
99
|
+
publisher
|
100
|
+
else
|
101
|
+
nil
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
95
105
|
# recognize given name. Can be loaded once as ::NameDetector, e.g. in a Rails initializer
|
96
106
|
def name_detector
|
97
107
|
@name_detector ||= defined?(::NameDetector) ? ::NameDetector : nil
|
@@ -125,7 +135,7 @@ module Bolognese
|
|
125
135
|
"issued" => get_date(dates, "Issued") ? get_date_parts(get_date(dates, "Issued")) : nil,
|
126
136
|
"submitted" => Array.wrap(dates).find { |d| d["dateType"] == "Submitted" }.to_h.fetch("__content__", nil),
|
127
137
|
"abstract" => parse_attributes(descriptions, content: "description", first: true),
|
128
|
-
"container-title" =>
|
138
|
+
"container-title" => container_title,
|
129
139
|
"DOI" => doi,
|
130
140
|
"issue" => issue,
|
131
141
|
"page" => [first_page, last_page].compact.join("-").presence,
|
data/lib/bolognese/version.rb
CHANGED
@@ -23,7 +23,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
23
23
|
it "Dataset" do
|
24
24
|
input = "https://doi.org/10.5061/DRYAD.8515"
|
25
25
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
26
|
-
expect(subject.citation).to eq("Ollomo, B., Durand, P., Prugnolle, F., Douzery, E. J. P., Arnathau, C., Nkoghe, D., … Renaud, F. (2011). <i>Data from: A new malaria agent in African hominids.</i> (Version 1) [Data set].
|
26
|
+
expect(subject.citation).to eq("Ollomo, B., Durand, P., Prugnolle, F., Douzery, E. J. P., Arnathau, C., Nkoghe, D., … Renaud, F. (2011). <i>Data from: A new malaria agent in African hominids.</i> (Version 1) [Data set]. Dryad Digital Repository. https://doi.org/10.5061/dryad.8515")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|