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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 325e7c67f90b425a1498add3572540a3f5172e46
4
- data.tar.gz: 43d1bc36ba1a0a9135349e5d4189ab2bb2387b79
3
+ metadata.gz: e87af9e86d74a99d56b53a7d7219e58e9db14ac9
4
+ data.tar.gz: 134a6bf718133bcfbe88d9fe7fc3ebcb9739cda5
5
5
  SHA512:
6
- metadata.gz: dd66c9e2b9b6f4966f7daa4c620664faf66310a770d7229714ebc294681f1d906dd776150ecf919cb805926deb9901f0ada550c2fe03ec7cf48707e1b049572e
7
- data.tar.gz: a7ace8155d4e47908d867f7dca076f8de4de90f96a20b3479db8ee16d3a5b32d401a1f3359d3f8c7cd0afff9a3d0032c843d16b4bb5282bad034b1f86cf9b157
6
+ metadata.gz: d71c700bf8342afbb5119dcaa88efc3da6ebe65a8e734a2e0fb71c336e2d26929ed61ae170db252c96aeb512085e1afaaebd65c3ab84c20503aa21cc58f067f3
7
+ data.tar.gz: 56a37a1ae6f79814c3be1bbb1d4f752836d9fdb07bd10a34ac5fa783a1e79a42247549fc96314c7d169a66ce39b72dd59f5f96f5d34e8c0a8db6964ef76aa986
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (0.9.58)
4
+ bolognese (0.9.59)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (~> 4.1)
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "0.9.58"
2
+ VERSION = "0.9.59"
3
3
  end
@@ -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
- if type == "Dataset"
54
- xml.send("data-title", title)
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("article_title")).to eq("R Interface to the DataONE REST API")
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("article_title")).to eq("Maremma: a Ruby library for simplified network calls")
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")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.58
4
+ version: 0.9.59
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner