briard 2.6.6 → 2.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/briard/crossref_utils.rb +3 -3
- data/lib/briard/utils.rb +2 -0
- data/lib/briard/version.rb +1 -1
- data/spec/writers/crossref_writer_spec.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc88de35682d2303ecacefc1de0d3a9f17317e88837a46e735ae802d13c27a59
|
4
|
+
data.tar.gz: 64cca2161dae986f704a24e2ea260ed1bee6e56209af39817d09a18b6849a2bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8a2ad0465b519ed445fca4a7cb0f87403ba6a0ad35d9528aee40715288462910cdb4ad8fc98e63d65d2b371bb85a7b387d14e03e601100f4e9c2e7f54cd642c
|
7
|
+
data.tar.gz: 141048f413c0b0d8d9b0fadf5f2c9851963e892fed00d64207e03d1f8d3c07ce565965180e6c9750074cc65df6a29bd59df435b550ddea2b3e34229e5fe4398f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
briard (2.6.
|
4
|
+
briard (2.6.7)
|
5
5
|
activesupport (>= 4.2.5)
|
6
6
|
base32-url (>= 0.5.0, < 1)
|
7
7
|
benchmark_methods (~> 0.7)
|
@@ -212,7 +212,7 @@ GEM
|
|
212
212
|
rubocop-ast (>= 0.4.0)
|
213
213
|
rubocop-rake (0.6.0)
|
214
214
|
rubocop (~> 1.0)
|
215
|
-
rubocop-rspec (2.
|
215
|
+
rubocop-rspec (2.15.0)
|
216
216
|
rubocop (~> 1.33)
|
217
217
|
ruby-progressbar (1.11.0)
|
218
218
|
scanf (1.0.0)
|
@@ -48,7 +48,7 @@ module Briard
|
|
48
48
|
def insert_journal(xml)
|
49
49
|
xml.journal do
|
50
50
|
if language.present?
|
51
|
-
xml.journal_metadata('language' => language) do
|
51
|
+
xml.journal_metadata('language' => language[0..1]) do
|
52
52
|
xml.full_title(container['title'])
|
53
53
|
end
|
54
54
|
else
|
@@ -71,7 +71,7 @@ module Briard
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def insert_posted_content(xml)
|
74
|
-
posted_content = { 'type' => 'other', 'language' => language }.compact
|
74
|
+
posted_content = { 'type' => 'other', 'language' => language ? language[0..1] : nil }.compact
|
75
75
|
|
76
76
|
xml.posted_content(posted_content) do
|
77
77
|
insert_group_title(xml)
|
@@ -165,7 +165,7 @@ module Briard
|
|
165
165
|
|
166
166
|
def insert_crossref_alternate_identifiers(xml)
|
167
167
|
alternate_identifier = Array.wrap(identifiers).reject do |r|
|
168
|
-
r['identifierType']
|
168
|
+
%w[DOI, URL].include?(r['identifierType'])
|
169
169
|
end.first
|
170
170
|
return xml if alternate_identifier.blank?
|
171
171
|
|
data/lib/briard/utils.rb
CHANGED
@@ -1170,6 +1170,8 @@ module Briard
|
|
1170
1170
|
# strip milliseconds if there is a time, as it interferes with edtc parsing
|
1171
1171
|
# keep dates unchanged
|
1172
1172
|
def strip_milliseconds(iso8601_time)
|
1173
|
+
return iso8601_time.split(" ").first if iso8601_time.to_s.include? " "
|
1174
|
+
|
1173
1175
|
return iso8601_time.split(".").first + "Z" if iso8601_time.to_s.include? "."
|
1174
1176
|
|
1175
1177
|
return iso8601_time
|
data/lib/briard/version.rb
CHANGED
@@ -143,6 +143,9 @@ describe Briard::Metadata, vcr: true do
|
|
143
143
|
expect(subject.subjects).to eq([])
|
144
144
|
expect(subject.container).to eq('type' => 'Blog')
|
145
145
|
expect(subject.language).to eq('en-US')
|
146
|
+
expect(subject.dates).to eq([{"date"=>"2022-10-21", "dateType"=>"Issued"},
|
147
|
+
{"date"=>"2022-10-21", "dateType"=>"Created"},
|
148
|
+
{"date"=>"2022-10-21", "dateType"=>"Updated"}])
|
146
149
|
expect(subject.rights_list).to eq([{
|
147
150
|
'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/'
|
148
151
|
}])
|