pennmarc 1.4.0 → 1.4.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/lib/pennmarc/helpers/note.rb +1 -1
- data/lib/pennmarc/helpers/title.rb +2 -2
- data/lib/pennmarc/util.rb +1 -1
- data/lib/pennmarc/version.rb +1 -1
- data/spec/lib/pennmarc/helpers/note_spec.rb +70 -69
- data/spec/lib/pennmarc/helpers/title_spec.rb +12 -9
- 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: 81ebb88f882d1b92922aa5dc7338056b6831d4857f91ba1ed1710deb2b678f09
|
|
4
|
+
data.tar.gz: 9db8caa363ce8ab4515d62612e033c4e73c185fef68c2a5c115a3520928f95b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3a18e0ff157bdecd8a10cad8c72c4aeffece93dc06117740fb122e27ff972f5940f45b332c8bb3d6d57b05cff2c7b610fc57487b9ce7ae38700df96ca077764
|
|
7
|
+
data.tar.gz: 0cb04ac15f6f5aa1f7c86005b953bd86e5c952ab2de99479d04688d131bff991ec3a2bbe17a3cf2707bcfa613c71ed8beb2711951c5868c0d5cd4e240d0fca5a
|
|
@@ -156,7 +156,7 @@ module PennMARC
|
|
|
156
156
|
system_details_notes += record.fields(%w[344 880]).filter_map do |field|
|
|
157
157
|
next if field.tag == '880' && no_subfield_value_matches?(field, '6', /^344/)
|
|
158
158
|
|
|
159
|
-
sub3_and_other_subs(field, &subfield_in?(%w[a b c d e f g h]))
|
|
159
|
+
sub3_and_other_subs(field, &subfield_in?(%w[a b c d e f g h i j]))
|
|
160
160
|
end
|
|
161
161
|
system_details_notes += record.fields(%w[345 346 880]).filter_map do |field|
|
|
162
162
|
next if field.tag == '880' && no_subfield_value_matches?(field, '6', /^(345|346)/)
|
|
@@ -77,7 +77,7 @@ module PennMARC
|
|
|
77
77
|
# @return [Array<String>] array of auxiliary title values for search
|
|
78
78
|
def search_aux(record)
|
|
79
79
|
values = search_aux_values(record: record, title_type: :main, &subfield_not_in?(%w[c 6 8])) +
|
|
80
|
-
search_aux_values(record: record, title_type: :related, &
|
|
80
|
+
search_aux_values(record: record, title_type: :related, &subfield_in?(%w[s t])) +
|
|
81
81
|
search_aux_values(record: record, title_type: :entity, &subfield_in?(%w[t])) +
|
|
82
82
|
search_aux_values(record: record, title_type: :note, &subfield_in?(%w[t]))
|
|
83
83
|
values.uniq
|
|
@@ -105,7 +105,7 @@ module PennMARC
|
|
|
105
105
|
# @return [Array<String>] auxiliary journal title information for search
|
|
106
106
|
def journal_search_aux(record)
|
|
107
107
|
values = search_aux_values(record: record, title_type: :main, journal: true, &subfield_not_in?(%w[c 6 8])) +
|
|
108
|
-
search_aux_values(record: record, title_type: :related, journal: true, &
|
|
108
|
+
search_aux_values(record: record, title_type: :related, journal: true, &subfield_in?(%w[s t])) +
|
|
109
109
|
search_aux_values(record: record, title_type: :entity, journal: true, &subfield_in?(%w[t])) +
|
|
110
110
|
search_aux_values(record: record, title_type: :note, journal: true, &subfield_in?(%w[t]))
|
|
111
111
|
values.uniq
|
data/lib/pennmarc/util.rb
CHANGED
|
@@ -147,7 +147,7 @@ module PennMARC
|
|
|
147
147
|
string.strip
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
-
# @param trailer [Symbol
|
|
150
|
+
# @param trailer [Symbol, String] to target for removal
|
|
151
151
|
# @param string [String] to modify
|
|
152
152
|
# @return [String]
|
|
153
153
|
def trim_trailing(trailer, string)
|
data/lib/pennmarc/version.rb
CHANGED
|
@@ -224,89 +224,90 @@ describe 'PennMARC::Note' do
|
|
|
224
224
|
expect(values).to contain_exactly('An Abstract Additional Summary ProQuest',
|
|
225
225
|
'Alt Abstract Alt Additional Summary Alt ProQuest')
|
|
226
226
|
end
|
|
227
|
+
end
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
describe '.arrangement_show' do
|
|
230
|
+
let(:record) { marc_record(fields: fields) }
|
|
230
231
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
232
|
+
let(:fields) do
|
|
233
|
+
[
|
|
234
|
+
marc_field(tag: '351', subfields: { a: 'Organized into five subseries', b: 'Arrangement pattern', c: 'Series',
|
|
235
|
+
'3': 'materials' }),
|
|
236
|
+
marc_field(tag: '880', subfields: { a: 'Alt organization', b: 'Alt arrangement', c: 'Alt hierarchical level',
|
|
237
|
+
'3': 'Alt materials', '6': '351' })
|
|
238
|
+
]
|
|
239
|
+
end
|
|
239
240
|
|
|
240
|
-
|
|
241
|
+
let(:values) { helper.arrangement_show(record) }
|
|
241
242
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
end
|
|
243
|
+
it 'returns expected values from 351 and its linked alternate' do
|
|
244
|
+
expect(values).to contain_exactly('Organized into five subseries Arrangement pattern Series materials',
|
|
245
|
+
'Alt organization Alt arrangement Alt hierarchical level Alt materials')
|
|
246
246
|
end
|
|
247
|
+
end
|
|
247
248
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
let(:fields) do
|
|
252
|
-
[
|
|
253
|
-
marc_field(tag: '538', subfields: { a: 'Blu-ray, region A, 1080p High Definition, full screen (1.33:1)',
|
|
254
|
-
i: 'display text for URI', u: 'http://www.universal.resource/locator ',
|
|
255
|
-
'3': ['Blu-ray disc.', '2015'] }),
|
|
256
|
-
marc_field(tag: '344', subfields: { a: 'digital', b: 'optical', c: '1.4 m/s', g: 'stereo',
|
|
257
|
-
h: 'digital recording', '3': 'audio disc' }),
|
|
258
|
-
marc_field(tag: '345', subfields: { a: '1 film reel (25 min.)', b: '24 fps', '3': 'Polyester print' }),
|
|
259
|
-
marc_field(tag: '346', subfields: { a: 'VHS', b: 'NTSC', '3': 'original videocassette' }),
|
|
260
|
-
marc_field(tag: '347', subfields: { a: 'video file', b: 'DVD video', e: 'region', '3': 'DVD' }),
|
|
261
|
-
marc_field(tag: '880', subfields: { a: 'Alt system details', i: 'Alternative display text', u: 'Alt URI',
|
|
262
|
-
'3': 'Alt materials.', '6': '538' }),
|
|
263
|
-
marc_field(tag: '880', subfields: { a: 'Alt recording', b: 'Alt medium', c: 'Alt playing speed',
|
|
264
|
-
g: 'Alt channel',
|
|
265
|
-
h: 'Alt characteristic', '3': 'Alt materials.',
|
|
266
|
-
'6': '344' }),
|
|
267
|
-
marc_field(tag: '880', subfields: { a: 'Alt presentation format', b: 'Alt projection speed',
|
|
268
|
-
'3': 'Alt materials.', '6': '345' }),
|
|
269
|
-
marc_field(tag: '880', subfields: { a: 'Alt video format', b: 'Alt broadcast', '3': 'Alt materials.',
|
|
270
|
-
'6': '346' }),
|
|
271
|
-
marc_field(tag: '880', subfields: { a: 'Alt file type', b: 'Alt encoding', '3': 'Alt materials.',
|
|
272
|
-
'6': '347-02' })
|
|
273
|
-
|
|
274
|
-
]
|
|
275
|
-
end
|
|
249
|
+
describe '.system_details_show' do
|
|
250
|
+
let(:record) { marc_record(fields: fields) }
|
|
276
251
|
|
|
277
|
-
|
|
252
|
+
let(:fields) do
|
|
253
|
+
[
|
|
254
|
+
marc_field(tag: '538', subfields: { a: 'Blu-ray, region A, 1080p High Definition, full screen (1.33:1)',
|
|
255
|
+
i: 'display text for URI', u: 'http://www.universal.resource/locator ',
|
|
256
|
+
'3': ['Blu-ray disc.', '2015'] }),
|
|
257
|
+
marc_field(tag: '344', subfields: { a: 'digital', b: 'optical', c: '1.4 m/s', g: 'stereo',
|
|
258
|
+
h: 'digital recording', i: 'sound', j: 'Electrical capture',
|
|
259
|
+
'3': 'audio disc' }),
|
|
260
|
+
marc_field(tag: '345', subfields: { a: '1 film reel (25 min.)', b: '24 fps', '3': 'Polyester print' }),
|
|
261
|
+
marc_field(tag: '346', subfields: { a: 'VHS', b: 'NTSC', '3': 'original videocassette' }),
|
|
262
|
+
marc_field(tag: '347', subfields: { a: 'video file', b: 'DVD video', e: 'region', '3': 'DVD' }),
|
|
263
|
+
marc_field(tag: '880', subfields: { a: 'Alt system details', i: 'Alternative display text', u: 'Alt URI',
|
|
264
|
+
'3': 'Alt materials.', '6': '538' }),
|
|
265
|
+
marc_field(tag: '880', subfields: { a: 'Alt recording', b: 'Alt medium', c: 'Alt playing speed',
|
|
266
|
+
g: 'Alt channel',
|
|
267
|
+
h: 'Alt characteristic', '3': 'Alt materials.',
|
|
268
|
+
'6': '344' }),
|
|
269
|
+
marc_field(tag: '880', subfields: { a: 'Alt presentation format', b: 'Alt projection speed',
|
|
270
|
+
'3': 'Alt materials.', '6': '345' }),
|
|
271
|
+
marc_field(tag: '880', subfields: { a: 'Alt video format', b: 'Alt broadcast', '3': 'Alt materials.',
|
|
272
|
+
'6': '346' }),
|
|
273
|
+
marc_field(tag: '880', subfields: { a: 'Alt file type', b: 'Alt encoding', '3': 'Alt materials.',
|
|
274
|
+
'6': '347-02' })
|
|
278
275
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
276
|
+
]
|
|
277
|
+
end
|
|
278
|
+
let(:values) { helper.system_details_show(record) }
|
|
279
|
+
|
|
280
|
+
it 'returns expected from 5xx and 3xx fields and their linked alternates' do
|
|
281
|
+
expect(values).to contain_exactly(
|
|
282
|
+
'Blu-ray disc: 2015 Blu-ray, region A, 1080p High Definition, full screen (1.33:1) display
|
|
282
283
|
text for URI http://www.universal.resource/locator'.squish,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
284
|
+
'audio disc digital optical 1.4 m/s stereo digital recording sound Electrical capture',
|
|
285
|
+
'Polyester print 1 film reel (25 min.) 24 fps',
|
|
286
|
+
'original videocassette VHS NTSC', 'DVD video file DVD video region',
|
|
287
|
+
'Alt materials Alt system details Alternative display text Alt URI',
|
|
288
|
+
'Alt materials Alt recording Alt medium Alt playing speed Alt channel Alt characteristic',
|
|
289
|
+
'Alt materials Alt presentation format Alt projection speed',
|
|
290
|
+
'Alt materials Alt video format Alt broadcast',
|
|
291
|
+
'Alt materials Alt file type Alt encoding'
|
|
292
|
+
)
|
|
292
293
|
end
|
|
294
|
+
end
|
|
293
295
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
+
describe '.bound_with_show' do
|
|
297
|
+
let(:record) { marc_record(fields: fields) }
|
|
296
298
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
let(:fields) do
|
|
300
|
+
[
|
|
301
|
+
marc_field(tag: '501', subfields: { a: 'With: Peer Gynt (Suite) no. 1-2 / Edvard Grieg' }),
|
|
302
|
+
marc_field(tag: '501', subfields: { a: 'With: Schumann, C. Romances, piano, op. 11. No. 2' })
|
|
303
|
+
]
|
|
304
|
+
end
|
|
303
305
|
|
|
304
|
-
|
|
306
|
+
let(:values) { helper.bound_with_show(record) }
|
|
305
307
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
end
|
|
308
|
+
it 'returns expected values' do
|
|
309
|
+
expect(values).to contain_exactly('With: Peer Gynt (Suite) no. 1-2 / Edvard Grieg',
|
|
310
|
+
'With: Schumann, C. Romances, piano, op. 11. No. 2')
|
|
310
311
|
end
|
|
311
312
|
end
|
|
312
313
|
end
|
|
@@ -57,7 +57,8 @@ describe 'PennMARC::Title' do
|
|
|
57
57
|
let(:fields) do
|
|
58
58
|
[marc_field(tag: '130', subfields: { a: 'Uniform Title', c: '130 not included' }),
|
|
59
59
|
marc_field(tag: '880', subfields: { '6': '130', a: 'Alternative Uniform Title' }),
|
|
60
|
-
marc_field(tag: '773', subfields: { a: 'Host
|
|
60
|
+
marc_field(tag: '773', subfields: { a: 'Host Item - Main entry heading', s: 'Host Item - Uniform title',
|
|
61
|
+
t: 'Host Item - Title' }),
|
|
61
62
|
marc_field(tag: '700', subfields: { t: 'Personal Entry Title', s: '700 not included' }),
|
|
62
63
|
marc_field(tag: '505', subfields: { t: 'Invalid Formatted Contents Note Title' }, indicator1: 'invalid'),
|
|
63
64
|
marc_field(tag: '505', subfields: { t: 'Formatted Contents Note Title', s: '505 not included' },
|
|
@@ -65,18 +66,18 @@ describe 'PennMARC::Title' do
|
|
|
65
66
|
end
|
|
66
67
|
|
|
67
68
|
it 'returns auxiliary titles' do
|
|
68
|
-
expect(helper.search_aux(record)).to contain_exactly('Uniform Title', '
|
|
69
|
-
'
|
|
70
|
-
'Formatted Contents Note Title')
|
|
69
|
+
expect(helper.search_aux(record)).to contain_exactly('Uniform Title', 'Alternative Uniform Title',
|
|
70
|
+
'Host Item - Uniform title Host Item - Title',
|
|
71
|
+
'Personal Entry Title', 'Formatted Contents Note Title')
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
context 'when the leader indicates the record is a serial' do
|
|
74
75
|
let(:leader) { 'ZZZZZnasZa22ZZZZZzZZ4500' }
|
|
75
76
|
|
|
76
77
|
it 'returns auxiliary titles' do
|
|
77
|
-
expect(helper.search_aux(record)).to contain_exactly('Uniform Title', '
|
|
78
|
-
'
|
|
79
|
-
'Formatted Contents Note Title')
|
|
78
|
+
expect(helper.search_aux(record)).to contain_exactly('Uniform Title', 'Alternative Uniform Title',
|
|
79
|
+
'Host Item - Uniform title Host Item - Title',
|
|
80
|
+
'Personal Entry Title', 'Formatted Contents Note Title')
|
|
80
81
|
end
|
|
81
82
|
end
|
|
82
83
|
end
|
|
@@ -107,7 +108,8 @@ describe 'PennMARC::Title' do
|
|
|
107
108
|
let(:fields) do
|
|
108
109
|
[marc_field(tag: '130', subfields: { a: 'Uniform Title', c: '130 not included' }),
|
|
109
110
|
marc_field(tag: '880', subfields: { '6': '130', a: 'Alternative Uniform Title' }),
|
|
110
|
-
marc_field(tag: '773', subfields: { a: 'Host
|
|
111
|
+
marc_field(tag: '773', subfields: { a: 'Host Item - Main entry heading', s: 'Host Item - Uniform title',
|
|
112
|
+
t: 'Host Item - Title' }),
|
|
111
113
|
marc_field(tag: '700', subfields: { t: 'Personal Entry Title', s: '700 not included' }),
|
|
112
114
|
marc_field(tag: '505', subfields: { t: 'Invalid Formatted Contents Note Title' }, indicator1: 'invalid'),
|
|
113
115
|
marc_field(tag: '505', subfields: { t: 'Formatted Contents Note Title', s: '505 not included' },
|
|
@@ -116,7 +118,8 @@ describe 'PennMARC::Title' do
|
|
|
116
118
|
|
|
117
119
|
it 'returns auxiliary journal search titles' do
|
|
118
120
|
expect(helper.journal_search_aux(record)).to contain_exactly('Uniform Title', 'Alternative Uniform Title',
|
|
119
|
-
'Host Uniform
|
|
121
|
+
'Host Item - Uniform title Host Item - Title',
|
|
122
|
+
'Personal Entry Title',
|
|
120
123
|
'Formatted Contents Note Title')
|
|
121
124
|
end
|
|
122
125
|
|
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.1
|
|
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-11-13 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: activesupport
|