pennmarc 1.2.9 → 1.2.11
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/lib/pennmarc/helpers/creator.rb +9 -9
- data/lib/pennmarc/mappings/locations.yml +18 -0
- data/lib/pennmarc/version.rb +1 -1
- data/spec/lib/pennmarc/helpers/creator_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae49ee72edbf272cad930745a43e21b914e38d742478b7b63a6f37b8ee470389
|
4
|
+
data.tar.gz: c510b96f00fac2417444b504761fc8e9fa3d276f0f4493fd5c5f5fe225ae1ed6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b669865747c50de240f48b528fefb6b81c9415706cb9ea899eca9310e21d71f80c29d76fbffa2875124f5818398c41cce0bd7afac336d3633844fc3e0447387
|
7
|
+
data.tar.gz: 5688fb5ea959c7438f8448e4073854dc98684118d01c825fa56fd613d4eea15be95d69b441c9c294f98b1606defcea85a52886f871e5bf692b91bd3b2232c383
|
@@ -131,11 +131,7 @@ module PennMARC
|
|
131
131
|
relator = trim_punctuation(relator).capitalize
|
132
132
|
|
133
133
|
name = trim_trailing(:comma, field['a'])
|
134
|
-
name =
|
135
|
-
name
|
136
|
-
else
|
137
|
-
"#{name} #{join_subfields(field, &subfield_in?(%w[b c d j q u 3]))}, #{relator}"
|
138
|
-
end
|
134
|
+
name = "#{name} #{join_subfields(field, &subfield_in?(%w[b c d j q u 3]))}, #{relator}" unless name_only
|
139
135
|
|
140
136
|
if contributors.key?(relator)
|
141
137
|
contributors[relator].push(name)
|
@@ -274,19 +270,23 @@ module PennMARC
|
|
274
270
|
# 'a', 'b', 'c', 'd', 'j', and 'q', 'u', and '3'. Then appends resulting string with any encoded relationships
|
275
271
|
# found in $4. If there are no valid encoded relationships, uses the value found in $e.
|
276
272
|
# @note legacy version returns array of hash objects including data for display link
|
277
|
-
# @todo is it okay to include 880 $4 here? Legacy includes $4 in main author display 880 but not here.
|
278
273
|
# @param record [MARC::Record]
|
279
274
|
# @param relator_map [Hash]
|
275
|
+
# @param name_only [Boolean]
|
276
|
+
# @param vernacular [Boolean]
|
280
277
|
# @return [Array<String>]
|
281
|
-
def contributor_show(record, relator_map: Mappers.relator)
|
278
|
+
def contributor_show(record, relator_map: Mappers.relator, name_only: false, vernacular: true)
|
282
279
|
indicator_2_options = ['', ' ', '0']
|
283
280
|
fields = record.fields(CONTRIBUTOR_TAGS)
|
284
|
-
|
281
|
+
if vernacular
|
282
|
+
fields += record.fields('880').select { |f| subfield_value?(f, '6', /^(#{CONTRIBUTOR_TAGS.join('|')})/) }
|
283
|
+
end
|
284
|
+
sf = name_only ? %w[a] : %w[a b c d j q u 3]
|
285
285
|
fields.filter_map { |field|
|
286
286
|
next if indicator_2_options.exclude?(field.indicator2) && field.tag.in?(CONTRIBUTOR_TAGS)
|
287
287
|
next if subfield_defined? field, 'i'
|
288
288
|
|
289
|
-
contributor = join_subfields(field, &subfield_in?(
|
289
|
+
contributor = join_subfields(field, &subfield_in?(sf))
|
290
290
|
append_relator(field: field, joined_subfields: contributor, relator_term_sf: 'e', relator_map: relator_map)
|
291
291
|
}.uniq
|
292
292
|
end
|
@@ -667,6 +667,10 @@ finemaps:
|
|
667
667
|
- Fisher Fine Arts Library
|
668
668
|
display: Fine Arts Library - Map Collection
|
669
669
|
aeon: true
|
670
|
+
finematl:
|
671
|
+
specific_location: Fisher Fine Arts Library - Materials Library
|
672
|
+
library: Fisher Fine Arts Library
|
673
|
+
display: Fisher Fine Arts Library - Materials Library
|
670
674
|
finerare:
|
671
675
|
specific_location: Fisher Fine Arts Library - Rare Book
|
672
676
|
library:
|
@@ -1418,6 +1422,13 @@ scstor:
|
|
1418
1422
|
- Van Pelt-Dietrich Library Center
|
1419
1423
|
display: Kislak Center for Special Collections - Rare Book Collection Storage
|
1420
1424
|
aeon: true
|
1425
|
+
scstorvil:
|
1426
|
+
specific_location: LIBRA Vilain-Wieck Collection
|
1427
|
+
library:
|
1428
|
+
- Special Collections
|
1429
|
+
- LIBRA
|
1430
|
+
display: LIBRA Vilain-Wieck Collection
|
1431
|
+
aeon: true
|
1421
1432
|
scteer:
|
1422
1433
|
specific_location: Kislak Center for Special Collections - Teerink Collection
|
1423
1434
|
library:
|
@@ -1518,6 +1529,13 @@ scrunning:
|
|
1518
1529
|
- LIBRA
|
1519
1530
|
display: LIBRA Running Press Collection
|
1520
1531
|
aeon: true
|
1532
|
+
storvilain:
|
1533
|
+
specific_location: LIBRA Vilain-Wieck Collection
|
1534
|
+
library:
|
1535
|
+
- Special Collections
|
1536
|
+
- LIBRA
|
1537
|
+
display: LIBRA Vilain-Wieck Collection
|
1538
|
+
aeon: true
|
1521
1539
|
univarch:
|
1522
1540
|
specific_location: University Archives
|
1523
1541
|
library: University Archives
|
data/lib/pennmarc/version.rb
CHANGED
@@ -453,6 +453,16 @@ describe 'PennMARC::Creator' do
|
|
453
453
|
'Alt Name Alt num Alt title Alt date Alt qualifier Alt Fuller Name Alt affiliation Alt material, Alt relator.'
|
454
454
|
)
|
455
455
|
end
|
456
|
+
|
457
|
+
it 'returns contributor name only when called with name_only as true' do
|
458
|
+
values = helper.contributor_show(record, relator_map: mapping, name_only: true)
|
459
|
+
expect(values).to contain_exactly('Name, Author.', 'Alt Name, Alt relator.')
|
460
|
+
end
|
461
|
+
|
462
|
+
it 'returns contributor values without alternatives when called with vernacular as false' do
|
463
|
+
values = helper.contributor_show(record, relator_map: mapping, vernacular: false)
|
464
|
+
expect(values).to contain_exactly('Name I laureate 1968 pseud Fuller Name affiliation materials, Author.')
|
465
|
+
end
|
456
466
|
end
|
457
467
|
|
458
468
|
context 'with a corporate contributor and linked alternate' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pennmarc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Kanning
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2025-
|
15
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|