bolognese 0.10.9 → 0.10.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d872984b3da9e316c667a4d17baa6d07d924bdd79243e995691644f79ac628e1
4
- data.tar.gz: 9c32234806fa73225b8dbc252dc90fbe5b1f6fc2744ce7b0f282fb8f161d87dc
3
+ metadata.gz: 31795668efc6bad81388f9f79652de6cb361fc6290f0d60774a030354700a4af
4
+ data.tar.gz: 9d5915a5d65c5bb5d1e3eeb5c1591f781cdfee0c85c2f6d23350d09558b17eb6
5
5
  SHA512:
6
- metadata.gz: bbc8e5ebf4afca31d432fe1a8825d7b9cec9e595b05db7e8ab3c23f9af1b8d08c2f4a2e71d30357fd911ba9629ab86e0cf4bca7938a6687ce90d7849bc7fa944
7
- data.tar.gz: e30767699d4862e255655f83d197630f31c60e37d63ee3194cc87dab7e202420959785ad041103a02def4ccae6b695c097fad7a38768b202e6fcf531e9e5309b
6
+ metadata.gz: 4d561eae35321a45ec22d678d911777c7102883bafa6b9b4c94306bd5291c73fac0cd98e53b59e5f8dce15a36456b554b8ef9a08cd757856b3df2a79b22a2bf9
7
+ data.tar.gz: 771b6bb4d55d9447163f42e97ed944ab000b227b60d9ccde99c3fd8776d9afbe8cf73165fac0b3fa7296f6ba525aab94fc9ecd94fab6bdd6ff7f71caeb62a964
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (0.10.9)
4
+ bolognese (0.10.10)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (~> 4.1)
@@ -27,8 +27,8 @@ module Bolognese
27
27
  def read_bibtex(string: nil, **options)
28
28
  meta = string.present? ? BibTeX.parse(string).first : OpenStruct.new
29
29
 
30
- type = BIB_TO_SO_TRANSLATIONS[meta.type.to_s] || "ScholarlyArticle"
31
- doi = meta.try(:doi)
30
+ type = BIB_TO_SO_TRANSLATIONS[meta.try(:type).to_s] || "ScholarlyArticle"
31
+ doi = meta.try(:doi).to_s.presence
32
32
 
33
33
  author = Array(meta.try(:author)).map do |a|
34
34
  { "type" => "Person",
@@ -51,9 +51,10 @@ module Bolognese
51
51
  { "id" => normalize_doi(doi),
52
52
  "type" => type,
53
53
  "bibtex_type" => meta.type.to_s,
54
- "citeproc_type" => BIB_TO_CP_TRANSLATIONS[meta.type.to_s] || "misc",
55
- "ris_type" => BIB_TO_RIS_TRANSLATIONS[meta.type.to_s] || "GEN",
54
+ "citeproc_type" => BIB_TO_CP_TRANSLATIONS[meta.try(:type).to_s] || "misc",
55
+ "ris_type" => BIB_TO_RIS_TRANSLATIONS[meta.try(:type).to_s] || "GEN",
56
56
  "resource_type_general" => Metadata::SO_TO_DC_TRANSLATIONS[type],
57
+ "additional_type" => Bolognese::Utils::BIB_TO_CR_TRANSLATIONS[meta.try(:type).to_s] || meta.try(:type).to_s,
57
58
  "doi" => doi,
58
59
  "b_url" => meta.try(:url).to_s,
59
60
  "title" => meta.try(:title).to_s,
@@ -128,6 +128,15 @@ module Bolognese
128
128
  "PostedContent" => "article"
129
129
  }
130
130
 
131
+ BIB_TO_CR_TRANSLATIONS = {
132
+ "proceedings" => "Proceedings",
133
+ "phdthesis" => "Dissertation",
134
+ "article" => "JournalArticle",
135
+ "book" => "Book",
136
+ "inbook" => "BookChapter",
137
+ "book" => "Monograph"
138
+ }
139
+
131
140
  CR_TO_JATS_TRANSLATIONS = {
132
141
  "Proceedings" => "working-paper",
133
142
  "ReferenceBook" => "book",
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "0.10.9"
2
+ VERSION = "0.10.10"
3
3
  end
@@ -47,8 +47,11 @@ describe Bolognese::Metadata, vcr: true do
47
47
  expect(subject.state).to eq("not_found")
48
48
  expect(subject.identifier).to eq("https://doi.org/10.7554/elife.01567")
49
49
  expect(subject.bibtex_type).to eq("phdthesis")
50
+ expect(subject.ris_type).to eq("THES")
51
+ expect(subject.citeproc_type).to eq("thesis")
50
52
  expect(subject.type).to eq("Thesis")
51
53
  expect(subject.resource_type_general).to eq("Text")
54
+ expect(subject.additional_type).to eq("Dissertation")
52
55
  expect(subject.author).to eq([{"type"=>"Person", "name"=>"Y. Toparlar", "givenName"=>"Y.", "familyName"=>"Toparlar"}])
53
56
  expect(subject.title).to eq("A multiscale analysis of the urban heat island effect: from city averaged temperatures to the energy demand of individual buildings")
54
57
  expect(subject.description["text"]).to start_with("Designing the climates of cities")
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.10.9
4
+ version: 0.10.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner