neu-mods 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/lib/neu/mods/projection.rb +8 -11
- 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: d7e678073c1e18b2626473e1e8fcec32052a2a33075d34cea6fe96dca40e8315
|
|
4
|
+
data.tar.gz: 5d3d44f6bf9ee5600dfdaded3a9d2119472e86c1aa6621fbcd92ea8358619738
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce304892f19636ecc57c487810a2ef2932f253d9702dcce6974a16c8e047b56ceeffb3ae25750bf2e5937345523567dd9d598ef59c32e671dcc80d62541748c8
|
|
7
|
+
data.tar.gz: a31247bacadff8b81b4789c2dc69647b2036b98e246af02492d1ecdfb14e1a625e1deb2f7c7ad7afff5298d531a6b6bcacfa803ab3ea7629ecea623e45e06667
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.7.
|
|
1
|
+
0.7.1
|
data/lib/neu/mods/projection.rb
CHANGED
|
@@ -116,9 +116,7 @@ module NEU
|
|
|
116
116
|
|
|
117
117
|
# Every <topic> under any top-level <subject> (the access-copy projection,
|
|
118
118
|
# equivalent to Atlas's extract_topical_subjects).
|
|
119
|
-
def topical_subjects
|
|
120
|
-
doc.xpath("/mods:mods/mods:subject/mods:topic", NAMESPACE).map { |t| clean(t.text) }
|
|
121
|
-
end
|
|
119
|
+
def topical_subjects = texts_at("/mods:mods/mods:subject/mods:topic")
|
|
122
120
|
|
|
123
121
|
# The other subject axes. Cerberus's IPTC ingest writes subject/geographic
|
|
124
122
|
# from the IPTC City and State fields, so this one was also being written
|
|
@@ -190,9 +188,7 @@ module NEU
|
|
|
190
188
|
def extent = texts_at("/mods:mods/mods:physicalDescription/mods:extent")
|
|
191
189
|
def digital_origin = texts_at("/mods:mods/mods:physicalDescription/mods:digitalOrigin")
|
|
192
190
|
|
|
193
|
-
def genres
|
|
194
|
-
doc.xpath("/mods:mods/mods:genre", NAMESPACE).map { |g| clean(g.text) }
|
|
195
|
-
end
|
|
191
|
+
def genres = texts_at("/mods:mods/mods:genre")
|
|
196
192
|
|
|
197
193
|
# originInfo repeats, and so do publisher and edition within one. Cerberus's
|
|
198
194
|
# IPTC ingest writes the publisher from the IPTC Source field on every batch,
|
|
@@ -263,9 +259,7 @@ module NEU
|
|
|
263
259
|
end
|
|
264
260
|
end
|
|
265
261
|
|
|
266
|
-
def identifiers
|
|
267
|
-
doc.xpath("/mods:mods/mods:identifier", NAMESPACE).map { |i| clean(i.text) }
|
|
268
|
-
end
|
|
262
|
+
def identifiers = texts_at("/mods:mods/mods:identifier")
|
|
269
263
|
|
|
270
264
|
def permanent_url
|
|
271
265
|
node = doc.at_xpath("/mods:mods/mods:identifier[@type='hdl']", NAMESPACE)
|
|
@@ -467,8 +461,11 @@ module NEU
|
|
|
467
461
|
node ? NEU::MODS.canonical_ws(node.text) : ""
|
|
468
462
|
end
|
|
469
463
|
|
|
470
|
-
# The :many counterpart of #text_at
|
|
471
|
-
#
|
|
464
|
+
# The :many counterpart of #text_at, and the one way this file builds a
|
|
465
|
+
# string array. Blank members drop out rather than arriving as nil: a
|
|
466
|
+
# record template that seeds an empty <topic> for an edit form to fill --
|
|
467
|
+
# which is exactly what Atlas's MODSBuilder writes -- otherwise projects
|
|
468
|
+
# [nil], and every consumer of that array has to guard for it.
|
|
472
469
|
def texts_at(xpath)
|
|
473
470
|
doc.xpath(xpath, NAMESPACE).filter_map { |node| clean(node.text) }
|
|
474
471
|
end
|