theoj 1.3.5 → 1.3.6

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: 1d4eda6794ed8caf83fea9942886089fd1ed2930af16b85fa89e0ad00cd04f57
4
- data.tar.gz: 70a8706ec93d152d9fea236a97ca7dc9f09c06b714efd4878038c41909010771
3
+ metadata.gz: c515c77887a35b68e134958d1fc4e3b5c7f3fe0f49857ce6588840b78c066082
4
+ data.tar.gz: 9ff11bb419fde2feea92704ad61435f74fa7353e5a69ab042fd6b1a43c18da91
5
5
  SHA512:
6
- metadata.gz: 2a0d2cbc961ceffc1ae0a81d86a9fd84d5541a04f93e488fae19fab59b3773a7285389a572347dc262daf497824db8fbef50117807effbbe3d3e5a9e01d89e9e
7
- data.tar.gz: bed10baa7f1e8384463aa4750d875c132868035fdec13c0c46bac39a497d71cbe752939323f83c8a84fe02f4d9e5eb3489cda0801ecbb975190d8b75898fb752
6
+ metadata.gz: 9a6436cde4cf744a217527d0000d7ef222735d769db36539874f9c98ddef6c8f4e16b57bcc7b69a6a380e1557d46faf9a96c71f6a7006bd904e6e47d4f968a08
7
+ data.tar.gz: 12b3e3893b21fa461b40fabcea661be6b43965fa92b6d02f8554f2dc079d6b209e924d34935ddbb8451590812c5fb62a84891e6f599844c40fbb43d8c6b5e2a4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.6 (2022-07-11)
4
+
5
+ - Improve parsing os author names
6
+
3
7
  ## 1.3.5 (2022-07-01)
4
8
 
5
9
  - Added configuration for JuliaCon
data/lib/theoj/author.rb CHANGED
@@ -45,7 +45,19 @@ module Theoj
45
45
  private
46
46
 
47
47
  def parse_name(author_name)
48
- @parsed_name = Nameable::Latin.new.parse(strip_footnotes(author_name))
48
+ if author_name.is_a? Hash
49
+ g = author_name["given-names"] || author_name["given"] || author_name["first"] || author_name["firstname"]
50
+ m = author_name["dropping-particle"]
51
+ s = author_name["surname"] || author_name["family"]
52
+
53
+ g = strip_footnotes(g) unless g.nil?
54
+ s = strip_footnotes(s) unless s.nil?
55
+
56
+ @parsed_name = m.nil? ? Nameable::Latin.new(g, s) : Nameable::Latin.new(g, m, s)
57
+ else
58
+ @parsed_name = Nameable::Latin.new.parse(strip_footnotes(author_name))
59
+ end
60
+
49
61
  @name = @parsed_name.to_nameable
50
62
  end
51
63
 
data/lib/theoj/paper.rb CHANGED
@@ -121,6 +121,7 @@ module Theoj
121
121
 
122
122
  # Loop through the authors block and build up the affiliation
123
123
  authors_metadata.each do |author|
124
+ author['name'] = author.dup if author['name'].nil?
124
125
  affiliation_index = author['affiliation']
125
126
  failure "Author (#{author['name']}) is missing affiliation" if affiliation_index.nil?
126
127
  begin
data/lib/theoj/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Theoj
2
- VERSION = "1.3.5"
2
+ VERSION = "1.3.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theoj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juanjo Bazán
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-01 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit