pennmarc 1.4.3 → 1.4.5
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 +2 -2
- data/lib/pennmarc/helpers/format.rb +23 -4
- data/lib/pennmarc/mappings/locations.yml +21 -14
- data/lib/pennmarc/version.rb +1 -1
- data/spec/lib/pennmarc/helpers/creator_spec.rb +10 -7
- data/spec/lib/pennmarc/helpers/format_spec.rb +20 -8
- 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: '081d17dd7ed356e36a029c244a36c6c8a5e1fd5670e17b8b13af945a888f9465'
|
|
4
|
+
data.tar.gz: e49fdb730bb47d7afeab2ed4ed47dba4fd8fa11f4c2b88d02b109d7c0a22a892
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66241f9ba06920b4563d1a20d2f219f8b7327b406a7dab717e392975410d4952781d94a5fafec5de0487fe8d0524cd73adc218c9d634ee3dba56e65a430e8738
|
|
7
|
+
data.tar.gz: e8c43cb88c4dedfb0e63e523c8ccbc88bf47448dc3ed190bb61ac3ec8244be1d9a4bd87d505c6ce7769962005602170889d8d02511d160cbf446fcd075da5c60
|
|
@@ -92,8 +92,8 @@ module PennMARC
|
|
|
92
92
|
fields = record.fields(TAGS + %w[700 710])
|
|
93
93
|
fields += record.fields('880').select { |field| subfield_value?(field, '6', /^(#{TAGS.join('|')})/) }
|
|
94
94
|
fields.filter_map { |field|
|
|
95
|
-
# for 700 and 880 entries, only include ones with relator code ('4') = aut, or code 'e' = 'author'
|
|
96
|
-
next if field.tag.in?(%w[700 880]) && !describes_author?(field)
|
|
95
|
+
# for 700, 710 and 880 entries, only include ones with relator code ('4') = aut, or code 'e' = 'author'
|
|
96
|
+
next if field.tag.in?(%w[700 710 880]) && !describes_author?(field)
|
|
97
97
|
|
|
98
98
|
parse_show_value(field, relator_map: relator_map)
|
|
99
99
|
}.uniq
|
|
@@ -85,7 +85,12 @@ module PennMARC
|
|
|
85
85
|
# any of these
|
|
86
86
|
formats << MANUSCRIPT if include_manuscripts?(format_code)
|
|
87
87
|
formats << ARCHIVE if archive?(record)
|
|
88
|
-
|
|
88
|
+
|
|
89
|
+
if micro_or_microform?(micro_code(record.leader, f006_forms, f008),
|
|
90
|
+
call_nums(record), f007, media_type, title_medium)
|
|
91
|
+
formats << MICROFORMAT
|
|
92
|
+
end
|
|
93
|
+
|
|
89
94
|
formats << THESIS_DISSERTATION if thesis_or_dissertation?(format_code, record)
|
|
90
95
|
formats << CONFERENCE_EVENT if conference_event?(record)
|
|
91
96
|
formats << NEWSPAPER if newspaper?(f008, format_code)
|
|
@@ -275,14 +280,28 @@ module PennMARC
|
|
|
275
280
|
record.fields('502').any? && format_code.in?(%w[am tm dm])
|
|
276
281
|
end
|
|
277
282
|
|
|
283
|
+
# @param leader [String]
|
|
284
|
+
# @param f006_forms [Array<String>]
|
|
285
|
+
# @param f008 [String]
|
|
286
|
+
# @return [String]
|
|
287
|
+
def micro_code(leader, f006_forms, f008)
|
|
288
|
+
map_or_visual = %w[e g k r]
|
|
289
|
+
|
|
290
|
+
if map_or_visual.include?(leader[6]) || f006_forms.any? { |str| map_or_visual.include?(str) }
|
|
291
|
+
f008[29] || ' '
|
|
292
|
+
else
|
|
293
|
+
f008[23] || ' '
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# @param micro_code [String]
|
|
278
298
|
# @param call_nums [Array<String>]
|
|
279
299
|
# @param f007 [Array<String>]
|
|
280
|
-
# @param f008 [String]
|
|
281
300
|
# @param title_medium [Array<String>]
|
|
282
301
|
# @param media_type [Array<String>]
|
|
283
302
|
# @return [Boolean]
|
|
284
|
-
def micro_or_microform?(call_nums, f007,
|
|
285
|
-
|
|
303
|
+
def micro_or_microform?(micro_code, call_nums, f007, media_type, title_medium)
|
|
304
|
+
%w[a b c].include?(micro_code) ||
|
|
286
305
|
f007.any? { |v| v.start_with?('h') } ||
|
|
287
306
|
title_medium.any? { |val| val =~ /micro/i } ||
|
|
288
307
|
call_nums.any? { |val| val =~ /micro/i } ||
|
|
@@ -1220,12 +1220,12 @@ scinc:
|
|
|
1220
1220
|
display: Kislak Center for Special Collections - Incunables
|
|
1221
1221
|
aeon: true
|
|
1222
1222
|
sckatzstor:
|
|
1223
|
-
specific_location: LIBRA Rare Library at the Katz Center
|
|
1223
|
+
specific_location: LIBRA - Rare Library at the Katz Center
|
|
1224
1224
|
library:
|
|
1225
1225
|
- Special Collections
|
|
1226
1226
|
- LIBRA
|
|
1227
1227
|
- Library at the Katz Center for Advanced Judaic Studies
|
|
1228
|
-
display: LIBRA Rare Library at the Katz Center
|
|
1228
|
+
display: LIBRA - Rare Library at the Katz Center
|
|
1229
1229
|
aeon: true
|
|
1230
1230
|
sclea:
|
|
1231
1231
|
specific_location: Kislak Center for Special Collections - Lea Collection
|
|
@@ -1361,12 +1361,19 @@ scstor:
|
|
|
1361
1361
|
- LIBRA
|
|
1362
1362
|
display: LIBRA - Rare Book Collection Storage
|
|
1363
1363
|
aeon: true
|
|
1364
|
+
scstorcomx:
|
|
1365
|
+
specific_location: LIBRA - Rare Comics Collection
|
|
1366
|
+
library:
|
|
1367
|
+
- Special Collections
|
|
1368
|
+
- LIBRA
|
|
1369
|
+
display: LIBRA - Rare Comics Collection
|
|
1370
|
+
aeon: true
|
|
1364
1371
|
scstorvil:
|
|
1365
|
-
specific_location: LIBRA Vilain-Wieck Collection
|
|
1372
|
+
specific_location: LIBRA - Vilain-Wieck Collection
|
|
1366
1373
|
library:
|
|
1367
1374
|
- Special Collections
|
|
1368
1375
|
- LIBRA
|
|
1369
|
-
display: LIBRA Vilain-Wieck Collection
|
|
1376
|
+
display: LIBRA - Vilain-Wieck Collection
|
|
1370
1377
|
aeon: true
|
|
1371
1378
|
scteer:
|
|
1372
1379
|
specific_location: Kislak Center for Special Collections - Teerink Collection
|
|
@@ -1432,41 +1439,41 @@ storcrstxt:
|
|
|
1432
1439
|
- GIC Collection
|
|
1433
1440
|
display: GIC Collection at Penn Libraries
|
|
1434
1441
|
storfine:
|
|
1435
|
-
specific_location: LIBRA Fisher Fine Arts
|
|
1442
|
+
specific_location: LIBRA - Fisher Fine Arts
|
|
1436
1443
|
library: LIBRA
|
|
1437
|
-
display: LIBRA Fisher Fine Arts
|
|
1444
|
+
display: LIBRA - Fisher Fine Arts
|
|
1438
1445
|
aeon: true
|
|
1439
1446
|
storm:
|
|
1440
1447
|
specific_location: LIBRA
|
|
1441
1448
|
library: LIBRA
|
|
1442
1449
|
display: LIBRA - Music
|
|
1443
1450
|
storlimit:
|
|
1444
|
-
specific_location: LIBRA Limited
|
|
1451
|
+
specific_location: LIBRA - Limited
|
|
1445
1452
|
library:
|
|
1446
1453
|
- Special Collections
|
|
1447
1454
|
- LIBRA
|
|
1448
|
-
display: LIBRA Limited
|
|
1455
|
+
display: LIBRA - Limited
|
|
1449
1456
|
aeon: true
|
|
1450
1457
|
storrare:
|
|
1451
|
-
specific_location: LIBRA Rare
|
|
1458
|
+
specific_location: LIBRA - Rare
|
|
1452
1459
|
library:
|
|
1453
1460
|
- Special Collections
|
|
1454
1461
|
- LIBRA
|
|
1455
|
-
display: LIBRA Rare
|
|
1462
|
+
display: LIBRA - Rare
|
|
1456
1463
|
aeon: true
|
|
1457
1464
|
storspec:
|
|
1458
|
-
specific_location: LIBRA Special
|
|
1465
|
+
specific_location: LIBRA - Special
|
|
1459
1466
|
library:
|
|
1460
1467
|
- Special Collections
|
|
1461
1468
|
- LIBRA
|
|
1462
|
-
display: LIBRA Special
|
|
1469
|
+
display: LIBRA - Special
|
|
1463
1470
|
aeon: true
|
|
1464
1471
|
scrunning:
|
|
1465
|
-
specific_location: LIBRA Running Press Collection
|
|
1472
|
+
specific_location: LIBRA - Running Press Collection
|
|
1466
1473
|
library:
|
|
1467
1474
|
- Special Collections
|
|
1468
1475
|
- LIBRA
|
|
1469
|
-
display: LIBRA Running Press Collection
|
|
1476
|
+
display: LIBRA - Running Press Collection
|
|
1470
1477
|
aeon: true
|
|
1471
1478
|
univarch:
|
|
1472
1479
|
specific_location: University Archives
|
data/lib/pennmarc/version.rb
CHANGED
|
@@ -112,26 +112,29 @@ describe 'PennMARC::Creator' do
|
|
|
112
112
|
end
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
context 'with a corporate author records in
|
|
115
|
+
context 'with an author in 100 and a corporate author records in 710' do
|
|
116
116
|
let(:fields) do
|
|
117
|
-
[marc_field(tag: '
|
|
118
|
-
marc_field(tag: '710', subfields: { a: '
|
|
117
|
+
[marc_field(tag: '100', subfields: { a: 'Sparky the Fire Dog', '4': 'aut' }),
|
|
118
|
+
marc_field(tag: '710', subfields: { a: 'National Fire Protection Association', '4': 'aut' })]
|
|
119
119
|
end
|
|
120
120
|
|
|
121
|
-
it 'returns
|
|
121
|
+
it 'returns two author values' do
|
|
122
122
|
values = helper.extended_show(record)
|
|
123
|
-
expect(values).to contain_exactly '
|
|
123
|
+
expect(values).to contain_exactly 'Sparky the Fire Dog, Author.',
|
|
124
|
+
'National Fire Protection Association, Author.'
|
|
124
125
|
end
|
|
125
126
|
end
|
|
126
127
|
|
|
127
|
-
context 'with author records in 100 and 700' do
|
|
128
|
+
context 'with author records in 100 and 700, and non-author content in 710' do
|
|
128
129
|
let(:fields) do
|
|
129
130
|
[marc_field(tag: '100', subfields: { a: 'Surname, Name', '0': 'http://cool.uri/12345', d: '1900-2000',
|
|
130
131
|
e: 'author.', '4': 'http://cool.uri/vocabulary/relators/aut' }),
|
|
131
132
|
marc_field(tag: '700', subfields: { a: 'Surname, Alternative', '6': '100', '4': 'aut' }),
|
|
132
133
|
marc_field(tag: '700', subfields: { a: 'Surname, Third', e: 'author.', '6': '100' }),
|
|
133
134
|
marc_field(tag: '700', subfields: { a: 'Surname, Ignore', e: 'editor.', '6': '100' }),
|
|
134
|
-
marc_field(tag: '700', subfields: { a: 'Surname, Not Included', '6': '100', '4': 'edt' })
|
|
135
|
+
marc_field(tag: '700', subfields: { a: 'Surname, Not Included', '6': '100', '4': 'edt' }),
|
|
136
|
+
marc_field(tag: '710',
|
|
137
|
+
subfields: { a: 'Culinary Archive and Library (University of Pennsylvania)' })]
|
|
135
138
|
end
|
|
136
139
|
|
|
137
140
|
it 'returns three authors' do
|
|
@@ -106,11 +106,11 @@ describe 'PennMARC::Format' do
|
|
|
106
106
|
end
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
-
context 'with 008 field
|
|
109
|
+
context 'with non-map/visual record (LDR06 and 006/00 not egkr) and 008 field valid value at position 23' do
|
|
110
110
|
let(:record) do
|
|
111
|
-
marc_record
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
marc_record leader: ' h',
|
|
112
|
+
fields: [marc_control_field(tag: '006', value: 'c '),
|
|
113
|
+
marc_control_field(tag: '008', value: ' a')]
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
it 'returns "Microformat"' do
|
|
@@ -118,11 +118,23 @@ describe 'PennMARC::Format' do
|
|
|
118
118
|
end
|
|
119
119
|
end
|
|
120
120
|
|
|
121
|
-
context 'with 008 field
|
|
121
|
+
context 'with map/visual record (LDR06 value egkr) and 008 field valid value at position 29' do
|
|
122
122
|
let(:record) do
|
|
123
|
-
marc_record
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
marc_record leader: ' k',
|
|
124
|
+
fields: [marc_control_field(tag: '008', value: ' b')]
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
it 'returns "Microformat"' do
|
|
128
|
+
expect(formats).to contain_exactly('Microformat')
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
context 'with map/visual record (LDR06 not egkr but 006/00 is), and 008 field valid value at position 29' do
|
|
133
|
+
let(:record) do
|
|
134
|
+
marc_record leader: ' h',
|
|
135
|
+
fields: [marc_control_field(tag: '006', value: 'a '),
|
|
136
|
+
marc_control_field(tag: '006', value: 'g '),
|
|
137
|
+
marc_control_field(tag: '008', value: ' c')]
|
|
126
138
|
end
|
|
127
139
|
|
|
128
140
|
it 'returns "Microformat"' 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.4.
|
|
4
|
+
version: 1.4.5
|
|
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: 2026-
|
|
15
|
+
date: 2026-05-15 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: activesupport
|