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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d64a16f26d26159e913ec23feff66571b34c3007e50724106f4dfdf555d97922
4
- data.tar.gz: 11673a0344a3b02467b9cf2d1de7bb0a982e29debc58ece207af900212fd849d
3
+ metadata.gz: dc88de35682d2303ecacefc1de0d3a9f17317e88837a46e735ae802d13c27a59
4
+ data.tar.gz: 64cca2161dae986f704a24e2ea260ed1bee6e56209af39817d09a18b6849a2bf
5
5
  SHA512:
6
- metadata.gz: 6b3c060bb7e30eccffaf37f2e03fb248c461fa5b0713ce61e33b6a226880425bfbb76375cb80f2ab81f15631ce116a95b87bc60d1804fdb7845cca4d3f6d958f
7
- data.tar.gz: 6b7acb768ed3a91c5812df3713bb31636a084f5decae98eeb1e31fc8c1e44088f5611e31087796b5d1a56928c70f0bca02795d97592000bd829e46ead588618d
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.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.14.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'] == 'DOI'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Briard
4
- VERSION = '2.6.6'
4
+ VERSION = '2.6.7'
5
5
  end
@@ -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
  }])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: briard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.6
4
+ version: 2.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner