pennmarc 1.4.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4a2e39c878c88cf1cdfdf3c72a102c8bb9b5677939e70b6e6824f0d027acfa3
4
- data.tar.gz: 062afb834246c65bedf207c28c5e8ea81d73926b36631be963a31459548537b4
3
+ metadata.gz: '081d17dd7ed356e36a029c244a36c6c8a5e1fd5670e17b8b13af945a888f9465'
4
+ data.tar.gz: e49fdb730bb47d7afeab2ed4ed47dba4fd8fa11f4c2b88d02b109d7c0a22a892
5
5
  SHA512:
6
- metadata.gz: 77c4b9f5133f7be9142970428718a634d762e120c04d3feed44c5a50b76415f81adc41b4c5ca1a31fe155bd0d7e80abf013fd7b843d52e20d3fbf2f837770326
7
- data.tar.gz: 3e74b0b50f37762ebb4c20ea3816a05f4664cecdc4084a535c10bb6db34c25a3a8545d25e726632031cc327d6dcf4a61dd8555e4e119a6060e663b128823558e
6
+ metadata.gz: 66241f9ba06920b4563d1a20d2f219f8b7327b406a7dab717e392975410d4952781d94a5fafec5de0487fe8d0524cd73adc218c9d634ee3dba56e65a430e8738
7
+ data.tar.gz: e8c43cb88c4dedfb0e63e523c8ccbc88bf47448dc3ed190bb61ac3ec8244be1d9a4bd87d505c6ce7769962005602170889d8d02511d160cbf446fcd075da5c60
@@ -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
- formats << MICROFORMAT if micro_or_microform?(call_nums(record), f007, f008, media_type, title_medium)
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, f008, media_type, title_medium)
285
- [f008[23], f008[29]].any? { |v| v.in?(%w[a b c]) } ||
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PennMARC
4
- VERSION = '1.4.4'
4
+ VERSION = '1.4.5'
5
5
  end
@@ -106,11 +106,11 @@ describe 'PennMARC::Format' do
106
106
  end
107
107
  end
108
108
 
109
- context 'with 008 field and valid value at position 23' do
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 fields: [
112
- marc_control_field(tag: '008', value: ' a')
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 and valid value at position 29' do
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 fields: [
124
- marc_control_field(tag: '008', value: ' a')
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
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-03-26 00:00:00.000000000 Z
15
+ date: 2026-05-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport