pennmarc 1.0.27 → 1.0.30

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: a6dec6a3d235117c15b3a37f368533a93e30ce4dfb11ac4832a612f878e653d9
4
- data.tar.gz: 4217da9f4a2126e46284c48f4aeaca09016f4abf6ce08c493e039dae20b4bc20
3
+ metadata.gz: '07810ba2a6de07713ce40a1cfbe7fc33d5497eec834011a0098ce2cbd74bc5ff'
4
+ data.tar.gz: 45c3f0002e46be338a63be2109153f7603d9ebf8b1814d825b4c889c7f7237b4
5
5
  SHA512:
6
- metadata.gz: 8f3f0163eb6c3b2afeb8bd8845762c1c208bbbb9efb586e3978f5f5584f73159adb2649a801d78c090e6349c72f69197b1e721acd3bdbe3a79e9f99ac11f23ee
7
- data.tar.gz: d4595b310f8a7b765a16738799b642fc05f680b681d4e090bca11a903ca7b748a25ca0981a260290c8544faea91b9437f7b98358f5358551e787dc0ae9ab8531
6
+ metadata.gz: 9a214837d1f061611a13ea7d09b13ae41d7f6f7df8f08d03da3d98d8969849aacb0edfd45a3fea231acb1e53f8c06c4e4793db49cf5274063d6c59d7b7043212
7
+ data.tar.gz: 1a6dd99e562ef38b301e49ac17b6ec211eb0af1e7bdccc6a0d98c15683163f9c4168e51b8560296282a42d6dacdbfbb5d8856628af7000614e48961cbcb6b19c
@@ -12,7 +12,7 @@ module PennMARC
12
12
  PHYS_INVENTORY_TAG = 'hld'
13
13
  ELEC_INVENTORY_TAG = 'prt'
14
14
  ITEM_TAG = 'itm'
15
- RELATED_RECORD_TAG = 'rel'
15
+ RELATED_RECORD_TAGS = %w[REL rel].freeze
16
16
 
17
17
  # Subfields for HLD tags
18
18
  # Follow MARC 852 spec: https://www.loc.gov/marc/holdings/hd852.html, but names are translated into Alma parlance
@@ -164,7 +164,7 @@ module PennMARC
164
164
  # @param [MARC::Record] record
165
165
  # @return [Array<String>]
166
166
  def host_record_id(record)
167
- record.fields(Enriched::Pub::RELATED_RECORD_TAG).filter_map { |field|
167
+ record.fields(Enriched::Pub::RELATED_RECORD_TAGS).filter_map { |field|
168
168
  next unless subfield_value?(field, 'c', /contains/i)
169
169
 
170
170
  subfield_values field, :w
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PennMARC
4
- VERSION = '1.0.27'
4
+ VERSION = '1.0.30'
5
5
  end
@@ -161,16 +161,36 @@ describe 'PennMARC::Identifier' do
161
161
  end
162
162
 
163
163
  describe '.host_record_id' do
164
- let(:record) do
165
- marc_record fields: [
166
- marc_field(tag: PennMARC::Enriched::Pub::RELATED_RECORD_TAG, subfields: { w: '123456789', c: 'Contains',
167
- a: 'Title' }),
168
- marc_field(tag: PennMARC::Enriched::Pub::RELATED_RECORD_TAG, subfields: { w: '666666666', c: 'Contained In' })
169
- ]
170
- end
171
-
172
- it 'returns only the desired host record MMS ID values' do
173
- expect(helper.host_record_id(record)).to contain_exactly '123456789'
164
+ context 'with a lower case tag' do
165
+ let(:record) do
166
+ marc_record fields: [
167
+ marc_field(tag: PennMARC::Enriched::Pub::RELATED_RECORD_TAGS.second, subfields: { w: '123456789',
168
+ c: 'Contains',
169
+ a: 'Title' }),
170
+ marc_field(tag: PennMARC::Enriched::Pub::RELATED_RECORD_TAGS.second, subfields: { w: '666666666',
171
+ c: 'Contained In' })
172
+ ]
173
+ end
174
+
175
+ it 'returns only the desired host record MMS ID values' do
176
+ expect(helper.host_record_id(record)).to contain_exactly '123456789'
177
+ end
178
+ end
179
+
180
+ context 'with an upper case tag' do
181
+ let(:record) do
182
+ marc_record fields: [
183
+ marc_field(tag: PennMARC::Enriched::Pub::RELATED_RECORD_TAGS.first, subfields: { w: '123456789',
184
+ c: 'Contains',
185
+ a: 'Title' }),
186
+ marc_field(tag: PennMARC::Enriched::Pub::RELATED_RECORD_TAGS.first, subfields: { w: '666666666',
187
+ c: 'Contained In' })
188
+ ]
189
+ end
190
+
191
+ it 'returns only the desired host record MMS ID values' do
192
+ expect(helper.host_record_id(record)).to contain_exactly '123456789'
193
+ end
174
194
  end
175
195
  end
176
196
  end
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.0.27
4
+ version: 1.0.30
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-07-14 00:00:00.000000000 Z
15
+ date: 2024-07-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport