pennmarc 1.4.2 → 1.4.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/creator.rb +3 -3
- data/lib/pennmarc/version.rb +1 -1
- data/spec/lib/pennmarc/helpers/creator_spec.rb +19 -4
- 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: d4a2e39c878c88cf1cdfdf3c72a102c8bb9b5677939e70b6e6824f0d027acfa3
|
|
4
|
+
data.tar.gz: 062afb834246c65bedf207c28c5e8ea81d73926b36631be963a31459548537b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77c4b9f5133f7be9142970428718a634d762e120c04d3feed44c5a50b76415f81adc41b4c5ca1a31fe155bd0d7e80abf013fd7b843d52e20d3fbf2f837770326
|
|
7
|
+
data.tar.gz: 3e74b0b50f37762ebb4c20ea3816a05f4664cecdc4084a535c10bb6db34c25a3a8545d25e726632031cc327d6dcf4a61dd8555e4e119a6060e663b128823558e
|
|
@@ -89,11 +89,11 @@ module PennMARC
|
|
|
89
89
|
# @param record [MARC::Record]
|
|
90
90
|
# @return [Array<String>] array of author/creator values for display
|
|
91
91
|
def extended_show(record, relator_map: Mappers.relator)
|
|
92
|
-
fields = record.fields(%w[
|
|
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
|
data/lib/pennmarc/version.rb
CHANGED
|
@@ -112,14 +112,29 @@ describe 'PennMARC::Creator' do
|
|
|
112
112
|
end
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
context 'with author
|
|
115
|
+
context 'with an author in 100 and a corporate author records in 710' do
|
|
116
|
+
let(:fields) do
|
|
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
|
+
end
|
|
120
|
+
|
|
121
|
+
it 'returns two author values' do
|
|
122
|
+
values = helper.extended_show(record)
|
|
123
|
+
expect(values).to contain_exactly 'Sparky the Fire Dog, Author.',
|
|
124
|
+
'National Fire Protection Association, Author.'
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
context 'with author records in 100 and 700, and non-author content in 710' do
|
|
116
129
|
let(:fields) do
|
|
117
130
|
[marc_field(tag: '100', subfields: { a: 'Surname, Name', '0': 'http://cool.uri/12345', d: '1900-2000',
|
|
118
131
|
e: 'author.', '4': 'http://cool.uri/vocabulary/relators/aut' }),
|
|
119
132
|
marc_field(tag: '700', subfields: { a: 'Surname, Alternative', '6': '100', '4': 'aut' }),
|
|
120
133
|
marc_field(tag: '700', subfields: { a: 'Surname, Third', e: 'author.', '6': '100' }),
|
|
121
134
|
marc_field(tag: '700', subfields: { a: 'Surname, Ignore', e: 'editor.', '6': '100' }),
|
|
122
|
-
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)' })]
|
|
123
138
|
end
|
|
124
139
|
|
|
125
140
|
it 'returns three authors' do
|
|
@@ -132,8 +147,8 @@ describe 'PennMARC::Creator' do
|
|
|
132
147
|
|
|
133
148
|
context 'with no 100 or 700 fields' do
|
|
134
149
|
let(:fields) do
|
|
135
|
-
[marc_field(tag: '
|
|
136
|
-
marc_field(tag: '880', subfields: { '6': '
|
|
150
|
+
[marc_field(tag: '111', subfields: { a: 'Group of People', b: 'Annual Meeting', '4': 'aut' }),
|
|
151
|
+
marc_field(tag: '880', subfields: { '6': '111', a: 'Alt. Group Name', b: 'Alt. Annual Meeting' })]
|
|
137
152
|
end
|
|
138
153
|
|
|
139
154
|
it 'returns empty' 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.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: 2026-03-
|
|
15
|
+
date: 2026-03-26 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: activesupport
|