bolognese 0.9.58 → 0.9.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/jats_writer.rb +18 -2
- data/spec/writers/jats_writer_spec.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e87af9e86d74a99d56b53a7d7219e58e9db14ac9
|
|
4
|
+
data.tar.gz: 134a6bf718133bcfbe88d9fe7fc3ebcb9739cda5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d71c700bf8342afbb5119dcaa88efc3da6ebe65a8e734a2e0fb71c336e2d26929ed61ae170db252c96aeb512085e1afaaebd65c3ab84c20503aa21cc58f067f3
|
|
7
|
+
data.tar.gz: 56a37a1ae6f79814c3be1bbb1d4f752836d9fdb07bd10a34ac5fa783a1e79a42247549fc96314c7d169a66ce39b72dd59f5f96f5d34e8c0a8db6964ef76aa986
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/version.rb
CHANGED
|
@@ -17,6 +17,9 @@ module Bolognese
|
|
|
17
17
|
insert_publication_date(xml)
|
|
18
18
|
insert_volume(xml) if volume.present?
|
|
19
19
|
insert_issue(xml) if issue.present?
|
|
20
|
+
insert_fpage(xml) if first_page.present?
|
|
21
|
+
insert_lpage(xml) if last_page.present?
|
|
22
|
+
insert_version(xml) if version.present?
|
|
20
23
|
insert_pub_id(xml)
|
|
21
24
|
end
|
|
22
25
|
|
|
@@ -50,8 +53,9 @@ module Bolognese
|
|
|
50
53
|
end
|
|
51
54
|
|
|
52
55
|
def insert_citation_title(xml)
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
case publication_type.fetch('publication-type', nil)
|
|
57
|
+
when "data" then xml.send("data-title", title)
|
|
58
|
+
when "software" then xml.send("software-title", title)
|
|
55
59
|
else
|
|
56
60
|
xml.send("article-title", title)
|
|
57
61
|
end
|
|
@@ -77,6 +81,18 @@ module Bolognese
|
|
|
77
81
|
xml.issue(issue)
|
|
78
82
|
end
|
|
79
83
|
|
|
84
|
+
def insert_fpage(xml)
|
|
85
|
+
xml.fpage(first_page)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def insert_lpage(xml)
|
|
89
|
+
xml.lpage(last_page)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def insert_version(xml)
|
|
93
|
+
xml.version(version)
|
|
94
|
+
end
|
|
95
|
+
|
|
80
96
|
def insert_pub_id(xml)
|
|
81
97
|
return nil unless doi.present?
|
|
82
98
|
xml.send("pub-id", doi, "pub-id-type" => "doi")
|
|
@@ -41,6 +41,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
41
41
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2006-12-20", "__content__"=>"2006")
|
|
42
42
|
expect(jats.dig("month")).to eq("12")
|
|
43
43
|
expect(jats.dig("day")).to eq("20")
|
|
44
|
+
expect(jats.dig("fpage")).to eq("e30")
|
|
44
45
|
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.1371/journal.pone.0000030")
|
|
45
46
|
end
|
|
46
47
|
|
|
@@ -53,6 +54,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
53
54
|
expect(jats.dig("source")).to eq("Jaypee Brothers Medical Publishers (P) Ltd.")
|
|
54
55
|
expect(jats.dig("person_group", "name")).to eq("surname"=>"Saha", "given_names"=>"Ashis")
|
|
55
56
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2015", "__content__"=>"2015")
|
|
57
|
+
expect(jats.dig("fpage")).to eq("27")
|
|
58
|
+
expect(jats.dig("lpage")).to eq("145")
|
|
56
59
|
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5005/jp/books/12414_3")
|
|
57
60
|
end
|
|
58
61
|
|
|
@@ -89,13 +92,14 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
89
92
|
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
|
90
93
|
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
|
91
94
|
expect(jats.dig("publication_type")).to eq("software")
|
|
92
|
-
expect(jats.dig("
|
|
95
|
+
expect(jats.dig("software_title")).to eq("R Interface to the DataONE REST API")
|
|
93
96
|
expect(jats.dig("source")).to eq("https://cran.r-project.org")
|
|
94
97
|
expect(jats.dig("person_group", "name").length).to eq(3)
|
|
95
98
|
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Jones", "given_names"=>"Matt")
|
|
96
99
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2016-05-27", "__content__"=>"2016")
|
|
97
100
|
expect(jats.dig("month")).to eq("05")
|
|
98
101
|
expect(jats.dig("day")).to eq("27")
|
|
102
|
+
expect(jats.dig("version")).to eq("2.0.0")
|
|
99
103
|
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5063/f1m61h5x")
|
|
100
104
|
end
|
|
101
105
|
|
|
@@ -104,7 +108,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
104
108
|
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
|
105
109
|
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
|
106
110
|
expect(jats.dig("publication_type")).to eq("software")
|
|
107
|
-
expect(jats.dig("
|
|
111
|
+
expect(jats.dig("software_title")).to eq("Maremma: a Ruby library for simplified network calls")
|
|
108
112
|
expect(jats.dig("source")).to eq("DataCite")
|
|
109
113
|
expect(jats.dig("person_group", "name")).to eq("surname"=>"Fenner", "given_names"=>"Martin")
|
|
110
114
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2017-02-24", "__content__"=>"2017")
|