stanford-mods 3.3.3 → 3.3.5

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: f9965ea8ea7f816965eec61fa92029644ba60a06eb42a70fb6f8807acbc60a99
4
- data.tar.gz: f7c66e2131c71ebafb854ac8a71c11bd6b53c3c964ce6991385923a7193811bc
3
+ metadata.gz: b3c8cd48602aa7d71d0187cd6351dd4496e908bea0520c2ad168be06607e78e6
4
+ data.tar.gz: e6159c3b26883f55945f1b182c2243d6019ff0106558b07e8c13226c69cf0d77
5
5
  SHA512:
6
- metadata.gz: 053b6d5241ad55d53f29c95cf4654af7af6f780685a1f3fa0b528570b8506dfc76d85bf4d1a72c90fa64177155763c8579035e141659e4a61a2e84ab2f67c222
7
- data.tar.gz: 595307259386899b1617baea478517a86b6b245e62345b496495e280478b8e6f7e58ddcb68443b010c1045f586dbe8a17e879bc020ce4c8c711630bd48b11189
6
+ metadata.gz: c837186247e98a97edcae6e53941df131cb63b3de584d5e8983cb96b161ee6f240d66497819a7e39fad9c0f3a91a50dfb40dadb95bd8b4ff390ba62eb96bcf44
7
+ data.tar.gz: e0461f103546a3f266ae61699765e0db14851034f7aacf1e03f138af49bcb823e6383b34dfafe333ca19ee6b0ce2cb4b227cc6b17016842c4987193a409aeabf
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby: [jruby-9.3.2.0, 2.7, '3.0', '3.1']
14
+ ruby: ['3.1', '3.2']
15
15
  steps:
16
16
  - uses: actions/checkout@v2
17
17
  - name: Set up Ruby
@@ -27,6 +27,9 @@ module Stanford
27
27
 
28
28
  edtf_date = date.date
29
29
 
30
+ # Protect against cases in which Date.edtf returns nil (e.g., 1uuu)
31
+ return unless edtf_date
32
+
30
33
  if edtf_date.is_a?(EDTF::Interval)
31
34
  edtf_date.from.year
32
35
  else
@@ -160,6 +160,8 @@ module Stanford
160
160
  end
161
161
 
162
162
  def sort_key
163
+ return unless date
164
+
163
165
  year = if date.is_a?(EDTF::Interval)
164
166
  date.from.year
165
167
  else
@@ -1,6 +1,6 @@
1
1
  module Stanford
2
2
  module Mods
3
3
  # this is the Ruby Gem version
4
- VERSION = '3.3.3'.freeze
4
+ VERSION = '3.3.5'.freeze
5
5
  end
6
6
  end
@@ -318,6 +318,22 @@ describe "computations from /originInfo field" do
318
318
  expect(record.pub_year_display_str).to eq nil
319
319
  end
320
320
  end
321
+
322
+ context 'with a date not handled by EDTF' do
323
+ let(:modsxml) do
324
+ <<-EOF
325
+ <mods xmlns="http://www.loc.gov/mods/v3">
326
+ <originInfo>
327
+ <dateIssued encoding="marc">1uuu</dateIssued>
328
+ </originInfo>
329
+ </mods>
330
+ EOF
331
+ end
332
+
333
+ it 'ignores the date' do
334
+ expect(record.pub_year_display_str).to eq nil
335
+ end
336
+ end
321
337
  end
322
338
 
323
339
  context '#pub_year_sort_str' do
@@ -426,6 +442,22 @@ describe "computations from /originInfo field" do
426
442
  end
427
443
  end
428
444
 
445
+ context 'with a date not handled by EDTF' do
446
+ let(:modsxml) do
447
+ <<-EOF
448
+ <mods xmlns="http://www.loc.gov/mods/v3">
449
+ <originInfo>
450
+ <dateIssued encoding="marc">1uuu</dateIssued>
451
+ </originInfo>
452
+ </mods>
453
+ EOF
454
+ end
455
+
456
+ it 'ignores the date' do
457
+ expect(record.pub_year_sort_str).to eq nil
458
+ end
459
+ end
460
+
429
461
  context 'when it has an open-ended date range' do
430
462
  let(:modsxml) do
431
463
  <<-EOF
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stanford-mods
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.3
4
+ version: 3.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-05 00:00:00.000000000 Z
12
+ date: 2023-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mods
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.4.10
217
+ rubygems_version: 3.3.7
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: Stanford specific wrangling of MODS metadata