briard 2.9.3 → 2.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/briard/crossref_utils.rb +3 -8
- data/lib/briard/readers/schema_org_reader.rb +2 -2
- data/lib/briard/version.rb +1 -1
- data/spec/writers/crossref_writer_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ce2b87b6b9a2b937d0ba4ee04cfa69376851ba89d36e475f23ed5a68fbb891f
|
4
|
+
data.tar.gz: 13699df8c5c34eaf7660cb49a77bee330b805ff3e68df5c3e67dcf18f91e430a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79380603529c8c27daafb342c17739fdc9a5ab7cabb0ad52abec052415316ab9cbaefba6ceea76715c1e49a4e3ec21eb23b90030add272f27a470dd825e3d5ac
|
7
|
+
data.tar.gz: d074e6e9a9f132707c46b8ba4320f038f06e5229aa95ba14dd67c42e4ccafe14b7191c756ce3c9b9ebada3a00d9b06beb9ed81f559231044b2362e25c27e95e0
|
data/Gemfile.lock
CHANGED
@@ -95,21 +95,16 @@ module Briard
|
|
95
95
|
|
96
96
|
def insert_crossref_creators(xml)
|
97
97
|
xml.contributors do
|
98
|
-
Array.wrap(creators).each_with_index do |
|
98
|
+
Array.wrap(creators).each_with_index do |person, index|
|
99
99
|
xml.person_name('contributor_role' => 'author',
|
100
100
|
'sequence' => index.zero? ? 'first' : 'additional') do
|
101
|
-
insert_crossref_person(xml,
|
101
|
+
insert_crossref_person(xml, person)
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
def insert_crossref_person(xml, person
|
108
|
-
person_name = if person['familyName'].present?
|
109
|
-
[person['familyName'], person['givenName']].compact.join(', ')
|
110
|
-
else
|
111
|
-
person['name']
|
112
|
-
end
|
107
|
+
def insert_crossref_person(xml, person)
|
113
108
|
xml.given_name(person['givenName']) if person['givenName'].present?
|
114
109
|
xml.surname(person['familyName']) if person['familyName'].present?
|
115
110
|
if person.dig('nameIdentifiers', 0, 'nameIdentifierScheme') == 'ORCID'
|
@@ -60,8 +60,8 @@ module Briard
|
|
60
60
|
'issn' => issn ? issn['content'] : nil }.compact
|
61
61
|
|
62
62
|
# workaround if not all authors are included with schema.org (e.g. in Ghost metadata)
|
63
|
-
authors = doc.css("meta[name='citation_author']").
|
64
|
-
{ 'name' => author['content'] }
|
63
|
+
authors = doc.css("meta[name='citation_author']").map do |author|
|
64
|
+
{ '@type' => 'Person', 'name' => author['content'] }
|
65
65
|
end
|
66
66
|
|
67
67
|
hsh['author'] = hsh['creator'] if hsh['author'].blank? && hsh['creator'].present?
|
data/lib/briard/version.rb
CHANGED
@@ -114,6 +114,8 @@ describe Briard::Metadata, vcr: true do
|
|
114
114
|
'title' => 'Front Matter', 'type' => 'Blog')
|
115
115
|
expect(subject.titles).to eq([{ 'title' => 'Editorial by more than 200 health journals: Call for emergency action to limit global temperature increases, restore biodiversity, and protect health' }])
|
116
116
|
crossref = Maremma.from_xml(subject.crossref).dig('doi_batch', 'body', 'posted_content')
|
117
|
+
expect(Array.wrap(crossref.dig('contributors', 'person_name')).length).to eq(1)
|
118
|
+
expect(Array.wrap(crossref.dig('contributors', 'person_name')).first).to eq("ORCID"=>"https://orcid.org/0000-0003-1419-2405", "contributor_role"=>"author", "given_name"=>"Martin", "sequence"=>"first", "surname"=>"Fenner")
|
117
119
|
expect(crossref.dig('titles',
|
118
120
|
'title')).to eq('Editorial by more than 200 health journals: Call for emergency action to limit global temperature increases, restore biodiversity, and protect health')
|
119
121
|
end
|
@@ -174,6 +176,8 @@ describe Briard::Metadata, vcr: true do
|
|
174
176
|
'rights' => 'Creative Commons Attribution 4.0 International', 'rightsUri' => 'https://creativecommons.org/licenses/by/4.0/legalcode', 'rightsIdentifier' => 'cc-by-4.0', 'rightsIdentifierScheme' => 'SPDX', 'schemeUri' => 'https://spdx.org/licenses/'
|
175
177
|
}])
|
176
178
|
crossref = Maremma.from_xml(subject.crossref).dig('doi_batch', 'body', 'posted_content')
|
179
|
+
expect(Array.wrap(crossref.dig('contributors', 'person_name')).length).to eq(4)
|
180
|
+
expect(Array.wrap(crossref.dig('contributors', 'person_name')).first).to eq("contributor_role"=>"author", "given_name"=>"Mohammad", "sequence"=>"first", "surname"=>"Hosseini")
|
177
181
|
expect(crossref.dig('titles',
|
178
182
|
'title')).to eq('Deep dive into ethics of Contributor Roles: report of a FORCE11 workshop')
|
179
183
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: briard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|