bolognese 0.9.55 → 0.9.56
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 +16 -15
- data/lib/bolognese/author_utils.rb +12 -1
- data/lib/bolognese/metadata.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/spec/spec_helper.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1022c2ebb6dac109eff056a0ebec7717a590af87
|
|
4
|
+
data.tar.gz: 92f75fd535284fea56aa0d1b28ed63444c9c9ce7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9fe97b6eb3be9a18a3b87877713a9573a422971a9f92b97006cf57f5ca7db7663fabb760f0237f4cb249a6e3277bddfd748f192341a0b370e340c84c0af8663d
|
|
7
|
+
data.tar.gz: cd915315950204de4bbc5737c1476f361cda398907f5a29943e54c158239f3a6529cda8ac848257577a57dfefe095203c6d92fa79562c7aaddf5868d29c334c7
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
bolognese (0.9.
|
|
4
|
+
bolognese (0.9.56)
|
|
5
5
|
activesupport (>= 4.2.5, < 6)
|
|
6
6
|
benchmark_methods (~> 0.7)
|
|
7
7
|
bibtex-ruby (~> 4.1)
|
|
@@ -55,14 +55,15 @@ GEM
|
|
|
55
55
|
faraday (>= 0.7.4, < 1.0)
|
|
56
56
|
gender_detector (0.1.2)
|
|
57
57
|
unicode_utils (>= 1.3.0)
|
|
58
|
-
haml (5.0.
|
|
58
|
+
haml (5.0.4)
|
|
59
59
|
temple (>= 0.8.0)
|
|
60
60
|
tilt
|
|
61
61
|
hamster (3.0.0)
|
|
62
62
|
concurrent-ruby (~> 1.0)
|
|
63
63
|
hashdiff (0.3.7)
|
|
64
64
|
htmlentities (4.3.4)
|
|
65
|
-
i18n (0.
|
|
65
|
+
i18n (0.9.0)
|
|
66
|
+
concurrent-ruby (~> 1.0)
|
|
66
67
|
json (2.1.0)
|
|
67
68
|
json-ld (2.1.7)
|
|
68
69
|
multi_json (~> 1.12)
|
|
@@ -76,7 +77,7 @@ GEM
|
|
|
76
77
|
loofah (2.1.1)
|
|
77
78
|
crass (~> 1.0.2)
|
|
78
79
|
nokogiri (>= 1.5.9)
|
|
79
|
-
maremma (3.
|
|
80
|
+
maremma (3.6)
|
|
80
81
|
activesupport (>= 4.2.5, < 6)
|
|
81
82
|
addressable (>= 2.3.6)
|
|
82
83
|
builder (~> 3.2, >= 3.2.2)
|
|
@@ -125,19 +126,19 @@ GEM
|
|
|
125
126
|
rdf (~> 2.2)
|
|
126
127
|
rdf-xsd (2.2.0)
|
|
127
128
|
rdf (~> 2.1)
|
|
128
|
-
rspec (3.
|
|
129
|
-
rspec-core (~> 3.
|
|
130
|
-
rspec-expectations (~> 3.
|
|
131
|
-
rspec-mocks (~> 3.
|
|
132
|
-
rspec-core (3.
|
|
133
|
-
rspec-support (~> 3.
|
|
134
|
-
rspec-expectations (3.
|
|
129
|
+
rspec (3.7.0)
|
|
130
|
+
rspec-core (~> 3.7.0)
|
|
131
|
+
rspec-expectations (~> 3.7.0)
|
|
132
|
+
rspec-mocks (~> 3.7.0)
|
|
133
|
+
rspec-core (3.7.0)
|
|
134
|
+
rspec-support (~> 3.7.0)
|
|
135
|
+
rspec-expectations (3.7.0)
|
|
135
136
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
136
|
-
rspec-support (~> 3.
|
|
137
|
-
rspec-mocks (3.
|
|
137
|
+
rspec-support (~> 3.7.0)
|
|
138
|
+
rspec-mocks (3.7.0)
|
|
138
139
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
139
|
-
rspec-support (~> 3.
|
|
140
|
-
rspec-support (3.
|
|
140
|
+
rspec-support (~> 3.7.0)
|
|
141
|
+
rspec-support (3.7.0)
|
|
141
142
|
rspec-xsd (0.1.0)
|
|
142
143
|
nokogiri (~> 1.6)
|
|
143
144
|
rspec (~> 3)
|
|
@@ -2,6 +2,10 @@ require 'namae'
|
|
|
2
2
|
|
|
3
3
|
module Bolognese
|
|
4
4
|
module AuthorUtils
|
|
5
|
+
# include BenchmarkMethods
|
|
6
|
+
#
|
|
7
|
+
# benchmark :get_authors
|
|
8
|
+
|
|
5
9
|
IDENTIFIER_SCHEME_URIS = {
|
|
6
10
|
"ORCID" => "http://orcid.org/"
|
|
7
11
|
}
|
|
@@ -82,10 +86,17 @@ module Bolognese
|
|
|
82
86
|
author.fetch("familyName", "").present? ||
|
|
83
87
|
(author.fetch("name", "").include?(",") &&
|
|
84
88
|
author.fetch("name", "").exclude?(";")) ||
|
|
85
|
-
|
|
89
|
+
name_exists?(author.fetch("name", "").split(" ").first)
|
|
86
90
|
false
|
|
87
91
|
end
|
|
88
92
|
|
|
93
|
+
# recognize given name if we have loaded ::NameDetector data, e.g. in a Rails initializer
|
|
94
|
+
def name_exists?(name)
|
|
95
|
+
return false unless name_detector.present?
|
|
96
|
+
|
|
97
|
+
name_detector.name_exists?(name)
|
|
98
|
+
end
|
|
99
|
+
|
|
89
100
|
# parse array of author strings into CSL format
|
|
90
101
|
def get_authors(authors)
|
|
91
102
|
Array.wrap(authors).map { |author| get_one_author(author) }.unwrap
|
data/lib/bolognese/metadata.rb
CHANGED
|
@@ -351,7 +351,7 @@ module Bolognese
|
|
|
351
351
|
|
|
352
352
|
# recognize given name. Can be loaded once as ::NameDetector, e.g. in a Rails initializer
|
|
353
353
|
def name_detector
|
|
354
|
-
@name_detector ||= defined?(::NameDetector) ? ::NameDetector :
|
|
354
|
+
@name_detector ||= defined?(::NameDetector) ? ::NameDetector : nil
|
|
355
355
|
end
|
|
356
356
|
|
|
357
357
|
def publication_year
|
data/lib/bolognese/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bolognese
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.56
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Fenner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-10-
|
|
11
|
+
date: 2017-10-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: maremma
|
|
@@ -871,7 +871,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
871
871
|
version: '0'
|
|
872
872
|
requirements: []
|
|
873
873
|
rubyforge_project:
|
|
874
|
-
rubygems_version: 2.6.
|
|
874
|
+
rubygems_version: 2.6.14
|
|
875
875
|
signing_key:
|
|
876
876
|
specification_version: 4
|
|
877
877
|
summary: Ruby client library for conversion of DOI Metadata
|