pennmarc 1.2.2 → 1.2.4
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/genre.rb +4 -1
- data/lib/pennmarc/helpers/subject.rb +2 -2
- data/lib/pennmarc/helpers/title.rb +5 -0
- data/lib/pennmarc/mappings/locations.yml +6 -0
- data/lib/pennmarc/version.rb +1 -1
- data/spec/lib/pennmarc/helpers/genre_spec.rb +7 -5
- data/spec/lib/pennmarc/helpers/subject_spec.rb +7 -2
- data/spec/lib/pennmarc/helpers/title_spec.rb +81 -98
- 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: fc24e1fe4c30a2cf49fe06d466deaff8ac61677b69b3ce673cebfb3729282ed7
|
4
|
+
data.tar.gz: cb7d013328a775f8c09d79cb4400374c4bb5ef5b97056e19c595d29707440469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15de4dca697023774cdbde7cfd805fab906c21f56d39824539204b796e0e25cac86415c971a73ec7c8bd8e6c9983fa8f9edb0231cbb942ef8880dfd7c968ad6c
|
7
|
+
data.tar.gz: a0d344dae1edbb7d7d4cd57ce698dd04007dfc30af9a981ff0db8708c5f1afe1b55347ec62ab4f544b51d5e187a95a945584d3c593f58f48804b691b384692b3
|
@@ -43,7 +43,8 @@ module PennMARC
|
|
43
43
|
}.uniq
|
44
44
|
end
|
45
45
|
|
46
|
-
# Genre values for faceting. We only set Genre facet values for movies (videos) and manuscripts(?)
|
46
|
+
# Genre values for faceting. We only set Genre facet values for movies (videos) and manuscripts(?), and ensure
|
47
|
+
# that the headings come from our set of approved ontologies.
|
47
48
|
# @todo the Genre facet in Franklin is pretty ugly. It could be cleaned up by limiting the subfields included
|
48
49
|
# here and cleaning up punctuation.
|
49
50
|
# @param record [MARC::Record]
|
@@ -55,6 +56,8 @@ module PennMARC
|
|
55
56
|
return [] unless manuscript || video
|
56
57
|
|
57
58
|
record.fields('655').filter_map { |field|
|
59
|
+
next unless allowed_genre_field?(field)
|
60
|
+
|
58
61
|
join_subfields field, &subfield_not_in?(%w[0 2 5 c])
|
59
62
|
}.uniq
|
60
63
|
end
|
@@ -39,7 +39,7 @@ module PennMARC
|
|
39
39
|
# TODO: use term hash here? pro/chr would be rejected...
|
40
40
|
# TODO: should we care about punctuation in a search field? relator mapping?
|
41
41
|
case subfield.code
|
42
|
-
when '5', '6', '8' then next
|
42
|
+
when '5', '6', '8', '7' then next
|
43
43
|
when 'a'
|
44
44
|
# remove %PRO or PRO or %CHR or CHR
|
45
45
|
# remove any ? at the end
|
@@ -249,7 +249,7 @@ module PennMARC
|
|
249
249
|
vernacular: field.tag == '880' }
|
250
250
|
field.each do |subfield|
|
251
251
|
case subfield.code
|
252
|
-
when '0', '6', '8', '5'
|
252
|
+
when '0', '6', '8', '5', '7'
|
253
253
|
# explicitly ignore these subfields
|
254
254
|
next
|
255
255
|
when '1'
|
@@ -32,6 +32,9 @@ module PennMARC
|
|
32
32
|
# This text is used in Alma to indicate a Bib record is a "Host" record for other bibs (bound-withs)
|
33
33
|
HOST_BIB_TITLE = 'Host bibliographic record for boundwith'
|
34
34
|
|
35
|
+
# Title to use when no 245 field is present. This "shouldn't" occur, but it does.
|
36
|
+
NO_TITLE_PROVIDED = '[No title provided]'
|
37
|
+
|
35
38
|
class << self
|
36
39
|
# Main Title Search field. Takes from {https://www.loc.gov/marc/bibliographic/bd245.html 245} and linked 880.
|
37
40
|
# @note Ported from get_title_1_search_values.
|
@@ -93,6 +96,8 @@ module PennMARC
|
|
93
96
|
# @return [String] single title for display
|
94
97
|
def show(record)
|
95
98
|
field = record.fields('245')&.first
|
99
|
+
return Array.wrap(NO_TITLE_PROVIDED) unless field.present?
|
100
|
+
|
96
101
|
values = title_values(field)
|
97
102
|
[format_title(values[:title_or_form]), values[:punctuation], values[:other_info]].compact_blank.join(' ')
|
98
103
|
end
|
@@ -592,6 +592,12 @@ dentshils:
|
|
592
592
|
- Health Sciences Libraries
|
593
593
|
- Levy Dental Medicine Library
|
594
594
|
display: Levy Dental Medicine Library - Shils Boardroom
|
595
|
+
dentwellrm:
|
596
|
+
specific_location: Levy Dental Medicine Library - Wellness Room
|
597
|
+
library:
|
598
|
+
- Health Sciences Libraries
|
599
|
+
- Levy Dental Medicine Library
|
600
|
+
display: Levy Dental Medicine Library - Wellness Room
|
595
601
|
dncirc:
|
596
602
|
specific_location: Levy Dental Medicine Library - Circulation
|
597
603
|
library:
|
data/lib/pennmarc/version.rb
CHANGED
@@ -47,7 +47,7 @@ describe 'PennMARC::Genre' do
|
|
47
47
|
let(:fields) do
|
48
48
|
[marc_control_field(tag: '007', value: 'x'),
|
49
49
|
marc_field(tag: 'hld', subfields: { c: 'vanp' }),
|
50
|
-
marc_field(tag: '655', indicator2: '
|
50
|
+
marc_field(tag: '655', indicator2: '0', subfields: { a: 'Genre.' })]
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'returns no genre values for faceting' do
|
@@ -59,11 +59,13 @@ describe 'PennMARC::Genre' do
|
|
59
59
|
let(:fields) do
|
60
60
|
[marc_control_field(tag: '007', value: 'v'),
|
61
61
|
marc_field(tag: 'hld', subfields: { c: 'vanp' }),
|
62
|
-
marc_field(tag: '655', indicator2: '
|
63
|
-
marc_field(tag: '655', indicator2: '7', subfields: { a: 'Sports' })
|
62
|
+
marc_field(tag: '655', indicator2: '0', subfields: { a: 'Documentary films' }),
|
63
|
+
marc_field(tag: '655', indicator2: '7', subfields: { a: 'Sports', '2': 'fast' }),
|
64
|
+
marc_field(tag: '655', indicator2: '7', subfields: { a: 'Le cyclisme', '2': 'qlsp' }), # excluded due to sf2
|
65
|
+
marc_field(tag: '655', indicator2: '1', subfields: { a: 'Shredding' })] # excluded, invalid indicator value
|
64
66
|
end
|
65
67
|
|
66
|
-
it 'contains the
|
68
|
+
it 'contains only the desired genre facet values' do
|
67
69
|
expect(values).to contain_exactly 'Documentary films', 'Sports'
|
68
70
|
end
|
69
71
|
end
|
@@ -72,7 +74,7 @@ describe 'PennMARC::Genre' do
|
|
72
74
|
let(:record) { marc_record fields: fields, leader: ' t' }
|
73
75
|
let(:fields) do
|
74
76
|
[marc_control_field(tag: '007', value: 'x'),
|
75
|
-
marc_field(tag: '655', indicator2: '7', subfields: { a: 'Astronomy', '2': '
|
77
|
+
marc_field(tag: '655', indicator2: '7', subfields: { a: 'Astronomy', '2': 'fast' })]
|
76
78
|
end
|
77
79
|
|
78
80
|
it 'returns the expected genre values' do
|
@@ -14,7 +14,8 @@ describe 'PennMARC::Subject' do
|
|
14
14
|
let(:fields) do
|
15
15
|
[marc_field(tag: '600', indicator2: '5', subfields: { a: 'Excluded Canadian' }),
|
16
16
|
marc_field(tag: '610', indicator2: '0', subfields: { a: 'University of Pennsylvania', b: 'Libraries' }),
|
17
|
-
marc_field(tag: '691', indicator2: '7', subfields: { a: 'Van Pelt Library', '2': 'local'
|
17
|
+
marc_field(tag: '691', indicator2: '7', subfields: { a: 'Van Pelt Library', '2': 'local',
|
18
|
+
'7': 'Heading derived magically.' }),
|
18
19
|
marc_field(tag: '696', indicator2: '4', subfields: { a: 'A Developer' }),
|
19
20
|
marc_field(tag: '880', indicator2: '0', subfields: { a: 'Alt. Name', '6': '610' })]
|
20
21
|
end
|
@@ -100,7 +101,7 @@ describe 'PennMARC::Subject' do
|
|
100
101
|
[marc_field(tag: '650', indicator2: '7',
|
101
102
|
subfields: {
|
102
103
|
a: 'Libraries,', d: '22nd Century,', x: 'History.', e: 'relator',
|
103
|
-
'2': 'fast', '0': 'http://fast.org/libraries'
|
104
|
+
'2': 'fast', '0': 'http://fast.org/libraries', '7': 'Heading derived magically.'
|
104
105
|
})]
|
105
106
|
end
|
106
107
|
|
@@ -117,6 +118,10 @@ describe 'PennMARC::Subject' do
|
|
117
118
|
expect(values.first).not_to include 'relator'
|
118
119
|
end
|
119
120
|
|
121
|
+
it 'excludes any values from ǂ7' do
|
122
|
+
expect(values.first).not_to include 'magically'
|
123
|
+
end
|
124
|
+
|
120
125
|
it 'includes active dates from ǂd' do
|
121
126
|
expect(values.first).to include '22nd Century'
|
122
127
|
end
|
@@ -2,13 +2,14 @@
|
|
2
2
|
|
3
3
|
describe 'PennMARC::Title' do
|
4
4
|
let(:helper) { PennMARC::Title }
|
5
|
+
let(:leader) { nil }
|
6
|
+
let(:fields) { [marc_field(tag: '245', subfields: subfields)] }
|
7
|
+
let(:record) { marc_record fields: fields, leader: leader }
|
5
8
|
|
6
9
|
describe '.search' do
|
7
|
-
let(:
|
8
|
-
|
9
|
-
|
10
|
-
marc_field(tag: '880', subfields: { a: 'Linked Title', '6': '245' })
|
11
|
-
]
|
10
|
+
let(:fields) do
|
11
|
+
[marc_field(tag: '245', subfields: { a: 'Title', b: 'Subtitle', c: 'Responsibility', h: 'Medium' }),
|
12
|
+
marc_field(tag: '880', subfields: { a: 'Linked Title', '6': '245' })]
|
12
13
|
end
|
13
14
|
|
14
15
|
it 'returns search values without ǂc or ǂh content' do
|
@@ -20,16 +21,14 @@ describe 'PennMARC::Title' do
|
|
20
21
|
|
21
22
|
describe '.search_aux' do
|
22
23
|
let(:leader) { 'ZZZZZnaaZa22ZZZZZzZZ4500' }
|
23
|
-
let(:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
indicator1: '0', indicator2: '0')
|
32
|
-
], leader: leader
|
24
|
+
let(:fields) do
|
25
|
+
[marc_field(tag: '130', subfields: { a: 'Uniform Title', c: '130 not included' }),
|
26
|
+
marc_field(tag: '880', subfields: { '6': '130', a: 'Alternative Uniform Title' }),
|
27
|
+
marc_field(tag: '773', subfields: { a: 'Host Uniform Title', s: '773 not included' }),
|
28
|
+
marc_field(tag: '700', subfields: { t: 'Personal Entry Title', s: '700 not included' }),
|
29
|
+
marc_field(tag: '505', subfields: { t: 'Invalid Formatted Contents Note Title' }, indicator1: 'invalid'),
|
30
|
+
marc_field(tag: '505', subfields: { t: 'Formatted Contents Note Title', s: '505 not included' },
|
31
|
+
indicator1: '0', indicator2: '0')]
|
33
32
|
end
|
34
33
|
|
35
34
|
it 'returns auxiliary titles' do
|
@@ -51,12 +50,10 @@ describe 'PennMARC::Title' do
|
|
51
50
|
|
52
51
|
describe '.journal_search' do
|
53
52
|
let(:leader) { 'ZZZZZnasZa22ZZZZZzZZ4500' }
|
54
|
-
let(:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
marc_field(tag: '880', subfields: { a: 'Unrelated 880', '6': 'invalid' })
|
59
|
-
], leader: leader
|
53
|
+
let(:fields) do
|
54
|
+
[marc_field(tag: '245', subfields: { a: 'Some Journal Title' }),
|
55
|
+
marc_field(tag: '880', subfields: { a: 'Alternative Script', '6': '245' }),
|
56
|
+
marc_field(tag: '880', subfields: { a: 'Unrelated 880', '6': 'invalid' })]
|
60
57
|
end
|
61
58
|
|
62
59
|
it 'returns journal search titles' do
|
@@ -74,16 +71,14 @@ describe 'PennMARC::Title' do
|
|
74
71
|
|
75
72
|
describe '.journal_search_aux' do
|
76
73
|
let(:leader) { 'ZZZZZnasZa22ZZZZZzZZ4500' }
|
77
|
-
let(:
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
indicator1: '0', indicator2: '0')
|
86
|
-
], leader: leader
|
74
|
+
let(:fields) do
|
75
|
+
[marc_field(tag: '130', subfields: { a: 'Uniform Title', c: '130 not included' }),
|
76
|
+
marc_field(tag: '880', subfields: { '6': '130', a: 'Alternative Uniform Title' }),
|
77
|
+
marc_field(tag: '773', subfields: { a: 'Host Uniform Title', s: '773 not included' }),
|
78
|
+
marc_field(tag: '700', subfields: { t: 'Personal Entry Title', s: '700 not included' }),
|
79
|
+
marc_field(tag: '505', subfields: { t: 'Invalid Formatted Contents Note Title' }, indicator1: 'invalid'),
|
80
|
+
marc_field(tag: '505', subfields: { t: 'Formatted Contents Note Title', s: '505 not included' },
|
81
|
+
indicator1: '0', indicator2: '0')]
|
87
82
|
end
|
88
83
|
|
89
84
|
it 'returns auxiliary journal search titles' do
|
@@ -102,9 +97,19 @@ describe 'PennMARC::Title' do
|
|
102
97
|
end
|
103
98
|
|
104
99
|
describe '.show' do
|
105
|
-
|
100
|
+
context 'with no 245' do
|
101
|
+
let(:fields) do
|
102
|
+
# Simulate a miscoded record
|
103
|
+
[marc_field(tag: '246', indicator1: '1', indicator2: '4', subfields: { a: 'The horn concertos', c: 'Mozart' })]
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'returns default title' do
|
107
|
+
expect(helper.show(record)).to eq [PennMARC::Title::NO_TITLE_PROVIDED]
|
108
|
+
end
|
109
|
+
end
|
106
110
|
|
107
111
|
context 'with ǂa, ǂk and ǂn defined' do
|
112
|
+
let(:fields) { [marc_field(tag: '245', subfields: subfields)] }
|
108
113
|
let(:subfields) { { a: 'Five Decades of MARC usage', k: 'journals', n: 'Part One' } }
|
109
114
|
|
110
115
|
it 'returns single title value with text from ǂa and ǂn but not ǂk' do
|
@@ -113,6 +118,7 @@ describe 'PennMARC::Title' do
|
|
113
118
|
end
|
114
119
|
|
115
120
|
context 'with no ǂa but a ǂk and ǂn defined' do
|
121
|
+
let(:fields) { [marc_field(tag: '245', subfields: subfields)] }
|
116
122
|
let(:subfields) { { k: 'journals', n: 'Part One' } }
|
117
123
|
|
118
124
|
it 'returns single title value with text from ǂk and ǂn' do
|
@@ -140,10 +146,8 @@ describe 'PennMARC::Title' do
|
|
140
146
|
|
141
147
|
describe '.detailed_show' do
|
142
148
|
context 'with subfields ǂk, ǂf and ǂc' do
|
143
|
-
let(:
|
144
|
-
|
145
|
-
marc_field(tag: '245', subfields: { k: 'Letters,', f: '1972-1982,', b: 'to Lewis Mumford.' })
|
146
|
-
]
|
149
|
+
let(:fields) do
|
150
|
+
[marc_field(tag: '245', subfields: { k: 'Letters,', f: '1972-1982,', b: 'to Lewis Mumford.' })]
|
147
151
|
end
|
148
152
|
|
149
153
|
it 'returns detailed title values' do
|
@@ -152,10 +156,8 @@ describe 'PennMARC::Title' do
|
|
152
156
|
end
|
153
157
|
|
154
158
|
context 'with subfields ǂk and ǂb' do
|
155
|
-
let(:
|
156
|
-
|
157
|
-
marc_field(tag: '245', subfields: { k: 'Letters', b: 'to Lewis Mumford.' })
|
158
|
-
]
|
159
|
+
let(:fields) do
|
160
|
+
[marc_field(tag: '245', subfields: { k: 'Letters', b: 'to Lewis Mumford.' })]
|
159
161
|
end
|
160
162
|
|
161
163
|
it 'returns title value without dates' do
|
@@ -165,12 +167,10 @@ describe 'PennMARC::Title' do
|
|
165
167
|
|
166
168
|
# e.g., 9977704838303681
|
167
169
|
context 'with ǂa containing an " : " as well as inclusive dates' do
|
168
|
-
let(:
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
f: '1830 / ', c: 'by the author of Hobomok.' })
|
173
|
-
]
|
170
|
+
let(:fields) do
|
171
|
+
[marc_field(tag: '245', subfields: { a: 'The frugal housewife : ',
|
172
|
+
b: 'dedicated to those who are not ashamed of economy, ',
|
173
|
+
f: '1830 / ', c: 'by the author of Hobomok.' })]
|
174
174
|
end
|
175
175
|
|
176
176
|
it 'returns single title value with text from ǂa and ǂn' do
|
@@ -182,11 +182,9 @@ describe 'PennMARC::Title' do
|
|
182
182
|
end
|
183
183
|
|
184
184
|
describe '.alternate_show' do
|
185
|
-
let(:
|
186
|
-
|
187
|
-
|
188
|
-
marc_field(tag: '880', subfields: { '6': '245', k: 'Lettres', b: 'à Lewis Mumford.' })
|
189
|
-
]
|
185
|
+
let(:fields) do
|
186
|
+
[marc_field(tag: '245', subfields: { k: 'Letters', b: 'to Lewis Mumford. ' }),
|
187
|
+
marc_field(tag: '880', subfields: { '6': '245', k: 'Lettres', b: 'à Lewis Mumford.' })]
|
190
188
|
end
|
191
189
|
|
192
190
|
context 'with subfields ǂk and ǂb' do
|
@@ -196,10 +194,8 @@ describe 'PennMARC::Title' do
|
|
196
194
|
end
|
197
195
|
|
198
196
|
context 'when 880 field is not present' do
|
199
|
-
let(:
|
200
|
-
|
201
|
-
marc_field(tag: '245', subfields: { k: 'Letters', b: 'to Lewis Mumford. ' })
|
202
|
-
]
|
197
|
+
let(:fields) do
|
198
|
+
[marc_field(tag: '245', subfields: { k: 'Letters', b: 'to Lewis Mumford. ' })]
|
203
199
|
end
|
204
200
|
|
205
201
|
it 'returns nil' do
|
@@ -210,10 +206,9 @@ describe 'PennMARC::Title' do
|
|
210
206
|
|
211
207
|
describe '.sort' do
|
212
208
|
context 'with no 245' do
|
213
|
-
let(:
|
209
|
+
let(:fields) do
|
214
210
|
# Simulate a miscoded record
|
215
|
-
|
216
|
-
subfields: { a: 'The horn concertos', c: 'Mozart' })]
|
211
|
+
[marc_field(tag: '246', indicator1: '1', indicator2: '4', subfields: { a: 'The horn concertos', c: 'Mozart' })]
|
217
212
|
end
|
218
213
|
|
219
214
|
it 'returns nil' do
|
@@ -222,14 +217,12 @@ describe 'PennMARC::Title' do
|
|
222
217
|
end
|
223
218
|
|
224
219
|
context 'with a record with a valid indicator2 value' do
|
225
|
-
let(:
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
})
|
232
|
-
]
|
220
|
+
let(:fields) do
|
221
|
+
[marc_field(tag: '245', indicator2: '4', subfields: {
|
222
|
+
a: 'The Record Title',
|
223
|
+
b: 'Remainder', n: 'Number', p: 'Section',
|
224
|
+
h: 'Do not display'
|
225
|
+
})]
|
233
226
|
end
|
234
227
|
|
235
228
|
it 'properly removes and appends the number of characters specified in indicator 2' do
|
@@ -244,8 +237,8 @@ describe 'PennMARC::Title' do
|
|
244
237
|
end
|
245
238
|
|
246
239
|
context 'with a record with no indicator2 value' do
|
247
|
-
let(:
|
248
|
-
|
240
|
+
let(:fields) do
|
241
|
+
[marc_field(tag: '245', subfields: { a: 'The Record Title' })]
|
249
242
|
end
|
250
243
|
|
251
244
|
it 'does not transform the title value' do
|
@@ -254,9 +247,7 @@ describe 'PennMARC::Title' do
|
|
254
247
|
end
|
255
248
|
|
256
249
|
context 'with a record with no ǂa and no indicator2 value' do
|
257
|
-
let(:
|
258
|
-
marc_record fields: [marc_field(tag: '245', subfields: { k: 'diaries' })]
|
259
|
-
end
|
250
|
+
let(:fields) { [marc_field(tag: '245', subfields: { k: 'diaries' })] }
|
260
251
|
|
261
252
|
it 'uses ǂk (form) value without transformation' do
|
262
253
|
expect(helper.sort(record)).to eq 'diaries'
|
@@ -264,9 +255,7 @@ describe 'PennMARC::Title' do
|
|
264
255
|
end
|
265
256
|
|
266
257
|
context 'with a record with a leading bracket' do
|
267
|
-
let(:
|
268
|
-
marc_record fields: [marc_field(tag: '245', subfields: { a: '[The Record Title]' })]
|
269
|
-
end
|
258
|
+
let(:fields) { [marc_field(tag: '245', subfields: { a: '[The Record Title]' })] }
|
270
259
|
|
271
260
|
# TODO: is this the expected behavior? It would sort right, but looks silly.
|
272
261
|
it 'removes the leading bracket and appends it to the full value' do
|
@@ -276,17 +265,15 @@ describe 'PennMARC::Title' do
|
|
276
265
|
end
|
277
266
|
|
278
267
|
describe '.standardized_show' do
|
279
|
-
let(:
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
marc_field(tag: '880', subfields: { '6': '100', a: 'Alt Ignore' })
|
289
|
-
]
|
268
|
+
let(:fields) do
|
269
|
+
[marc_field(tag: '130', subfields: { a: 'Uniform Title', f: '2000', '8': 'Not Included' }),
|
270
|
+
marc_field(tag: '240', subfields: { a: 'Another Uniform Title', '0': 'Ugly Control Number' }),
|
271
|
+
marc_field(tag: '730', indicator2: '', subfields: { a: 'Yet Another Uniform Title' }),
|
272
|
+
marc_field(tag: '730', indicator1: '0', indicator2: '2', subfields: { a: 'Not Printed Title' }),
|
273
|
+
marc_field(tag: '730', indicator1: '', subfields: { i: 'Subfield i Title' }),
|
274
|
+
marc_field(tag: '880', subfields: { '6': '240', a: 'Translated Uniform Title' }),
|
275
|
+
marc_field(tag: '880', subfields: { '6': '730', a: 'Alt Ignore', i: 'Alt Subfield i' }),
|
276
|
+
marc_field(tag: '880', subfields: { '6': '100', a: 'Alt Ignore' })]
|
290
277
|
end
|
291
278
|
|
292
279
|
it 'returns the expected standardized title display values' do
|
@@ -299,13 +286,11 @@ describe 'PennMARC::Title' do
|
|
299
286
|
end
|
300
287
|
|
301
288
|
describe '.other_show' do
|
302
|
-
let(:
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
marc_field(tag: '880', subfields: { '6': '246', a: 'Alternate Varied Title' })
|
308
|
-
]
|
289
|
+
let(:fields) do
|
290
|
+
[marc_field(tag: '246', subfields: { a: 'Varied Title', f: '2000', '8': 'Not Included' }),
|
291
|
+
marc_field(tag: '740', indicator2: '0', subfields: { a: 'Uncontrolled Title', '5': 'Penn' }),
|
292
|
+
marc_field(tag: '740', indicator2: '2', subfields: { a: 'A Title We Do Not Like' }),
|
293
|
+
marc_field(tag: '880', subfields: { '6': '246', a: 'Alternate Varied Title' })]
|
309
294
|
end
|
310
295
|
|
311
296
|
it 'returns the expected other title display values' do
|
@@ -316,11 +301,9 @@ describe 'PennMARC::Title' do
|
|
316
301
|
end
|
317
302
|
|
318
303
|
describe '.former_show' do
|
319
|
-
let(:
|
320
|
-
|
321
|
-
|
322
|
-
marc_field(tag: '880', subfields: { a: 'Alt Title', n: 'Part', '6': '247' })
|
323
|
-
]
|
304
|
+
let(:fields) do
|
305
|
+
[marc_field(tag: '247', subfields: { a: 'Former Title', n: 'Part', '6': 'Linkage', e: 'Append' }),
|
306
|
+
marc_field(tag: '880', subfields: { a: 'Alt Title', n: 'Part', '6': '247' })]
|
324
307
|
end
|
325
308
|
|
326
309
|
it 'returns the expected former title value' do
|
@@ -331,7 +314,7 @@ describe 'PennMARC::Title' do
|
|
331
314
|
end
|
332
315
|
|
333
316
|
describe '.host_bib_record?' do
|
334
|
-
let(:
|
317
|
+
let(:fields) { [marc_field(tag: '245', subfields: subfields)] }
|
335
318
|
|
336
319
|
context 'with a host record' do
|
337
320
|
let(:subfields) { { a: "#{PennMARC::Title::HOST_BIB_TITLE} for 123456789" } }
|
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.4
|
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: 2024-
|
15
|
+
date: 2024-12-03 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|