stanford-mods 3.3.5 → 3.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stanford-mods/imprint.rb +5 -5
- data/lib/stanford-mods/version.rb +1 -1
- data/lib/stanford-mods.rb +1 -0
- data/spec/imprint_spec.rb +3 -0
- data/stanford-mods.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 292626c39e250361be721a184c0efdaf7d034c6aaacea914d476af067ba47258
|
4
|
+
data.tar.gz: 4f3f415cd1ac32139bbfba181cc5257402287df2c25af646085850dc710fb72b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1256f658bd9a3dbfc6994761c76b0be137144af944437a6ab479ee6fd512dd7723b2ebf8e9ac1e221c3364ee3c20fdc9effc0ca9b783d13d584ab6da166b1625
|
7
|
+
data.tar.gz: e98146dc149c668741f73ea2e7ef841ac284b23d99e71c3dd7646ce3c5b0f6fb19d66a2284c7294b8090fcd52370d18ebe0be833a7ae613ca4898921bd07dbe2
|
@@ -142,9 +142,9 @@ module Stanford
|
|
142
142
|
@value = value
|
143
143
|
end
|
144
144
|
|
145
|
-
# True if the element text isn't blank or
|
146
|
-
def
|
147
|
-
text.present? && !['9999', '0000-00-00', 'uuuu'].include?(text.strip)
|
145
|
+
# True if the element text isn't blank or one of a set of unparseable values.
|
146
|
+
def parseable?
|
147
|
+
text.present? && !['9999', '0000-00-00', 'uuuu', '[uuuu]'].include?(text.strip)
|
148
148
|
end
|
149
149
|
|
150
150
|
def key_date?
|
@@ -161,7 +161,7 @@ module Stanford
|
|
161
161
|
|
162
162
|
def sort_key
|
163
163
|
return unless date
|
164
|
-
|
164
|
+
|
165
165
|
year = if date.is_a?(EDTF::Interval)
|
166
166
|
date.from.year
|
167
167
|
else
|
@@ -341,7 +341,7 @@ module Stanford
|
|
341
341
|
|
342
342
|
def parse_dates(elements)
|
343
343
|
# convert to DateValue objects and keep only valid ones
|
344
|
-
dates = elements.map(&:as_object).flatten.map { |element| DateValue.new(element) }.select(&:
|
344
|
+
dates = elements.map(&:as_object).flatten.map { |element| DateValue.new(element) }.select(&:parseable?)
|
345
345
|
|
346
346
|
# join any date ranges into DateRange objects
|
347
347
|
point_dates, dates = dates.partition(&:point)
|
data/lib/stanford-mods.rb
CHANGED
data/spec/imprint_spec.rb
CHANGED
data/stanford-mods.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.test_files = gem.files.grep(%r{^spec/})
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
|
19
|
-
gem.add_dependency 'mods', '~> 3.0', '>= 3.0.
|
19
|
+
gem.add_dependency 'mods', '~> 3.0', '>= 3.0.4'
|
20
20
|
# active_support for .ordinalize, eg. 1 -> 1st, 2 -> 2nd for centuries
|
21
21
|
gem.add_dependency 'activesupport'
|
22
22
|
|
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.
|
4
|
+
version: 3.3.7
|
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-
|
12
|
+
date: 2023-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mods
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: '3.0'
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 3.0.
|
23
|
+
version: 3.0.4
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: '3.0'
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0.
|
33
|
+
version: 3.0.4
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: activesupport
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.
|
217
|
+
rubygems_version: 3.4.13
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: Stanford specific wrangling of MODS metadata
|