pennmarc 1.0.10 → 1.0.11.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27d9b9618c0824c62064d486d486850948dd079dd9667c2955cc7c04556e4656
4
- data.tar.gz: d741e303841db97060e8747e751ebfa79e3b37b9391eec6ab072d71cb560267a
3
+ metadata.gz: 102f9a975e2d103cdec48de5ef76c1577216d1055f46893ca39ac40a9fd717aa
4
+ data.tar.gz: 759fef85e9a2f5cc69bd100cd8552912831c7f70df5066f52824ec51ab483e03
5
5
  SHA512:
6
- metadata.gz: 36b165a655fc431225d39004be0470e35760a41d62693455a63c2e6b6f346391803fdd7955b418b890a7531eb45b3a687fb5f9a5cd0a8aecce884ae3f8d2b82f
7
- data.tar.gz: 01cfac580c76988881af4b639957f6351db48f6998947b84e68aa3450c9c905bef9c04c5895489db063296d8e7810c332218fb5cf36ff42b3f4bb5cb519ea098
6
+ metadata.gz: e2fbd84b36717b7c24a3966a19912e59be09b258eea4d62f2905ff7f117786f0594a9a9e9a6da031c52e639bad2407efa5feeef65d092e991457a449e8a17259
7
+ data.tar.gz: 1297a465f711238695f9faace643c20d06f2a07e56ba641c239ee4af71db38c6a1067a073703f0898031cb76bad1c4c8668835d5970ab5f6fc58508af7596105
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,72 @@
1
+ include:
2
+ - project: "devops/gitlab/ci-templates/ruby"
3
+ ref: "sans-dind"
4
+ file:
5
+ - ".rspec.yml"
6
+ - ".rubocop.yml"
7
+ - template: "Workflows/MergeRequest-Pipelines.gitlab-ci.yml"
8
+
9
+ stages:
10
+ - test
11
+ - deploy
12
+
13
+ rspec_app_test:
14
+ stage: test
15
+ image: ruby:3.2.2
16
+ before_script:
17
+ - bundle install -j $(nproc)
18
+ extends:
19
+ - .rspec
20
+ tags:
21
+ - build
22
+
23
+ rubocop_app_test:
24
+ stage: test
25
+ image: ruby:3.2.2
26
+ before_script:
27
+ - bundle install -j $(nproc)
28
+ extends:
29
+ - .rubocop
30
+ tags:
31
+ - build
32
+ allow_failure: true
33
+
34
+ # This step was inspired from Gitlab's example of gem publication:
35
+ # https://gitlab.com/gitlab-org/quality/pipeline-common/-/blob/master/ci/gem-release.yml
36
+ gem_publication:
37
+ stage: deploy
38
+ image: ruby:3.2.2
39
+ variables:
40
+ GEMSPEC_FILE: "${CI_PROJECT_NAME}.gemspec"
41
+ VAULT_VERSION: "1.10.1"
42
+ before_script:
43
+ - |
44
+ apt-get update && apt-get -y install \
45
+ wget \
46
+ unzip && \
47
+ wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip -O /tmp/vault_${VAULT_VERSION}.zip && \
48
+ unzip /tmp/vault_${VAULT_VERSION}.zip -d /usr/bin && \
49
+ rm -fr /tmp/vault_${VAULT_VERSION}.zip && \
50
+ apt-get remove -y wget unzip && \
51
+ apt-get clean
52
+ - export VAULT_ADDR=${VAULT_URL}
53
+ - export VAULT_TOKEN="$(vault write -field=token auth/jwt/${CI_SERVER_HOST}/login role=${JWT_ROLE} jwt=${CI_JOB_JWT})"
54
+ - export GEM_HOST_API_KEY="$(vault kv get -field=rubygems_api_key ${VAULT_KV_ENDPOINT}${ENVIRONMENT})"
55
+ - |
56
+ gem -v
57
+ rm -f ./*.gem
58
+ [ -f "${GEMSPEC_FILE}" ] || (echo "No ${GEMSPEC_FILE} file found!" && exit 1)
59
+ - '[ -n "${GEM_HOST_API_KEY}" ] || (echo "GEM_HOST_API_KEY is not set!" && exit 1)'
60
+ script:
61
+ - GEM_FILE=$(echo "${CI_PROJECT_NAME}-${CI_COMMIT_TAG:1}.gem")
62
+ - |
63
+ gem build "${GEMSPEC_FILE}"
64
+ [ -f "${GEM_FILE}" ] || (echo "No ${GEM_FILE} file found!" && exit 1)
65
+ - '[ "${DISABLE_GEM_PUSH}" == "true" ] || gem push "${GEM_FILE}"'
66
+ rules:
67
+ - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+(\.[a-zA-Z0-9]+)?$/
68
+ artifacts:
69
+ paths:
70
+ - "*.gem"
71
+ tags:
72
+ - deploy
data/Gemfile.lock CHANGED
@@ -23,6 +23,8 @@ GEM
23
23
  racc (~> 1.4)
24
24
  nokogiri (1.15.2-x64-mingw-ucrt)
25
25
  racc (~> 1.4)
26
+ nokogiri (1.15.2-x86_64-darwin)
27
+ racc (~> 1.4)
26
28
  nokogiri (1.15.2-x86_64-linux)
27
29
  racc (~> 1.4)
28
30
  parallel (1.23.0)
@@ -104,6 +106,7 @@ PLATFORMS
104
106
  arm64-darwin-21
105
107
  arm64-darwin-22
106
108
  x64-mingw-ucrt
109
+ x86_64-darwin-21
107
110
  x86_64-linux
108
111
 
109
112
  DEPENDENCIES
data/README.md CHANGED
@@ -71,22 +71,20 @@ rspec
71
71
 
72
72
  ## Publishing the Gem
73
73
 
74
- 1. Update the `VERSION` constant in `lib/pennmarc/version.rb`.
75
- 2. Run `gem build pennmarc.gemspec` with the latest code
76
- 3. Run `gem push pennmarc-{version number here}.gem`(e.g. `gem push pennmarc-1.0.0.gem`) to push to RubyGems. You will need access and MFA setup with RubyGems.
77
-
78
- ## QA
79
-
80
- ### Checking output of an arbitrary MARC XML file
81
-
82
- TODO
83
-
84
- ```bash
85
- MARC_FILE=path/to/marc.xml bundle exec rake pennmarc:parse
86
- ```
87
-
88
- ## TODO
89
- - rake task or some similar command to return a full set of values extracted from a specified marcxml file
90
- - Pipeline to run tests and publish to Rubygems
91
- - rubocop check
92
- - rdoc/yard coverage checks?
74
+ 1. Update the `VERSION` constant in [lib/pennmarc/version.rb](lib/pennmarc/version.rb) following this gem's versioning pattern (ex 1.1.0).
75
+ 2. Merge the change into `main`.
76
+ 3. Create a Gitlab Release:
77
+ 1. Go to https://gitlab.library.upenn.edu/dld/catalog/pennmarc/-/releases/new
78
+ 2. Create a new tag that matches the version set in step 1 (ex: v1.1.0).
79
+ 3. Add a release title that is the same as the tag name.
80
+ 4. Submit by clicking "Create Release".
81
+ 4. Once the release is created a pipeline will run to publish the gem to RubyGems.
82
+
83
+ ### Versioning Guidelines
84
+
85
+ We do not explicitly follow [Semantic Versioning](https://semver.org/) principles, but follow it's general principles.
86
+ In common cases, here's what to do:
87
+
88
+ - Increment **MAJOR_VERSION** if the `Parser` class functionality is modified in a breaking fashion.
89
+ - Increment **MINOR_VERSION** if a `Helper` class is renamed, or if an existing helper method is renamed.
90
+ - Increment **PATCH_VERSION** if a new `Helper` class or method is added, of if any non-breaking bugfix is made.
@@ -42,6 +42,8 @@ module PennMARC
42
42
 
43
43
  SUB_PHYSICAL_CALL_NUMBER = 'd'
44
44
  SUB_PHYSICAL_CALL_NUMBER_TYPE = 'k'
45
+
46
+ SUB_HOLDING_LOCATION_CODE = 'j'
45
47
  end
46
48
  end
47
49
  end
@@ -5,8 +5,6 @@ module PennMARC
5
5
  class Access < Helper
6
6
  ONLINE = 'Online'
7
7
  AT_THE_LIBRARY = 'At the library'
8
- ELEC_AVAILABILITY_TAG = 'AVE'
9
- PHYS_AVAILABILITY_TAG = 'AVA'
10
8
 
11
9
  class << self
12
10
  # Based on enhanced metadata fields added by Alma publishing process or API, determine if the record has
@@ -35,14 +33,14 @@ module PennMARC
35
33
  # @param [MARC::Field] field
36
34
  # @return [Boolean]
37
35
  def electronic_holding_tag?(field)
38
- field.tag.in? [EnrichedMarc::TAG_ELECTRONIC_INVENTORY, ELEC_AVAILABILITY_TAG]
36
+ field.tag.in? [EnrichedMarc::TAG_ELECTRONIC_INVENTORY, EnrichedMarc::AlmaApi::TAG_ELECTRONIC_INVENTORY]
39
37
  end
40
38
 
41
39
  # Does the record have added physical holding info?
42
40
  # @param [MARC::Field] field
43
41
  # @return [Boolean]
44
42
  def physical_holding_tag?(field)
45
- field.tag.in? [EnrichedMarc::TAG_HOLDING, PHYS_AVAILABILITY_TAG]
43
+ field.tag.in? [EnrichedMarc::TAG_HOLDING, EnrichedMarc::AlmaApi::TAG_PHYSICAL_INVENTORY]
46
44
  end
47
45
 
48
46
  # Check if a record contains an 856 entry for an online finding aid, meeting these criteria:
@@ -20,7 +20,8 @@ module PennMARC
20
20
  end
21
21
 
22
22
  # Retrieve date added (subfield 'q') from enriched marc 'itm' field.
23
- # {PennMARC::EnrichedMarc} maps enriched marc fields and subfields created during Alma publishing.
23
+ # {PennMARC::EnrichedMarc} maps enriched marc fields and subfields created during Alma publishing. The enriched
24
+ # metadata provided by the Alma API does not include the date created value, so we can't work with that here.
24
25
  # @param [MARC::Record] record
25
26
  # @return [DateTime, nil] The date added, or nil if date found in record is invalid
26
27
  def added(record)
@@ -80,13 +80,6 @@ module PennMARC
80
80
  title_medium = subfield_values_for tag: '245', subfield: :h, record: record
81
81
  media_type = subfield_values_for tag: '337', subfield: :a, record: record
82
82
 
83
- # Get Call Number for holdings - ǂh gives us the 'Classification part' which can contain strings like
84
- # 'Microfilm'
85
- call_nums = record.fields(EnrichedMarc::TAG_HOLDING).map do |field|
86
- join_subfields(field, &subfield_in?([EnrichedMarc::SUB_HOLDING_CLASSIFICATION_PART,
87
- EnrichedMarc::SUB_HOLDING_ITEM_PART]))
88
- end
89
-
90
83
  # get all specific_location values from inventory info
91
84
  locations = Location.location record: record, location_map: location_map,
92
85
  display_value: :specific_location
@@ -95,7 +88,7 @@ module PennMARC
95
88
  formats << MANUSCRIPT
96
89
  elsif archives_but_not_cajs_or_nursing?(locations)
97
90
  formats << ARCHIVE
98
- elsif micro_or_microform?(call_nums, locations, media_type, title_medium)
91
+ elsif micro_or_microform?(call_nums(record), locations, media_type, title_medium)
99
92
  formats << MICROFORMAT
100
93
  else
101
94
  # any of these
@@ -167,6 +160,25 @@ module PennMARC
167
160
 
168
161
  private
169
162
 
163
+ # Get Call Numbers for holdings using the 'Classification part' which can contain strings like
164
+ # 'Microfilm'. Look in enriched tags used by both Alma Publishing and API.
165
+ # @param [MARC::Record] record
166
+ # @return [Array]
167
+ def call_nums(record)
168
+ if field_defined?(record, EnrichedMarc::TAG_HOLDING)
169
+ record.fields(EnrichedMarc::TAG_HOLDING).map do |field|
170
+ join_subfields(field, &subfield_in?([EnrichedMarc::SUB_HOLDING_CLASSIFICATION_PART,
171
+ EnrichedMarc::SUB_HOLDING_ITEM_PART]))
172
+ end
173
+ elsif field_defined?(record, EnrichedMarc::AlmaApi::TAG_PHYSICAL_INVENTORY)
174
+ record.fields(EnrichedMarc::AlmaApi::TAG_PHYSICAL_INVENTORY).map do |field|
175
+ join_subfields(field, &subfield_in?([EnrichedMarc::AlmaApi::SUB_PHYSICAL_CALL_NUMBER_TYPE]))
176
+ end
177
+ else
178
+ []
179
+ end
180
+ end
181
+
170
182
  # Get 'Curated' format from.
171
183
  # {https://upennlibrary.atlassian.net/wiki/spaces/ALMA/pages/323912493/Local+9XX+Field+Use+in+Alma local field
172
184
  # 944} ǂa, as long as it is not a numerical value.
@@ -85,9 +85,14 @@ module PennMARC
85
85
  tag = PennMARC::EnrichedMarc::TAG_HOLDING
86
86
  subfield_code = PennMARC::EnrichedMarc::SUB_HOLDING_SHELVING_LOCATION
87
87
 
88
- if record.fields(PennMARC::EnrichedMarc::TAG_ITEM).any?
88
+ # if the record has an enriched item field present, use it
89
+ if field_defined?(record, PennMARC::EnrichedMarc::TAG_ITEM)
89
90
  tag = PennMARC::EnrichedMarc::TAG_ITEM
90
91
  subfield_code = PennMARC::EnrichedMarc::SUB_ITEM_CURRENT_LOCATION
92
+ # otherwise, use the api enriched field value
93
+ elsif field_defined?(record, EnrichedMarc::AlmaApi::TAG_PHYSICAL_INVENTORY)
94
+ tag = EnrichedMarc::AlmaApi::TAG_PHYSICAL_INVENTORY
95
+ subfield_code = EnrichedMarc::AlmaApi::SUB_HOLDING_LOCATION_CODE
91
96
  end
92
97
 
93
98
  { tag: tag, subfield_code: subfield_code }
@@ -1,8 +1,4 @@
1
1
  ---
2
- 3eastelev:
3
- specific_location: Van Pelt - third floor east elevator lobby
4
- library: Van Pelt-Dietrich Library Center
5
- display: Van Pelt - third floor east elevator lobby
6
2
  afro:
7
3
  specific_location: Van Pelt - Africana Studies Resource Room
8
4
  library: Van Pelt-Dietrich Library Center
@@ -177,12 +173,6 @@ biomlibr:
177
173
  - Health Sciences Libraries
178
174
  - Holman Biotech Commons
179
175
  display: Holman Biotech Commons - Librarian's Office
180
- biomonli:
181
- specific_location: Holman Biotech Commons - Online Office
182
- library:
183
- - Health Sciences Libraries
184
- - Holman Biotech Commons
185
- display: Holman Biotech Commons - Online Office
186
176
  biomperi:
187
177
  specific_location: Holman Biotech Commons - Periodicals
188
178
  library:
@@ -550,10 +540,6 @@ dncirc:
550
540
  - Health Sciences Libraries
551
541
  - Levy Dental Medicine Library
552
542
  display: Levy Dental Medicine Library - Circulation
553
- easiacom:
554
- specific_location: Van Pelt - East Asia Compact Shelving
555
- library: Van Pelt-Dietrich Library Center
556
- display: Van Pelt - East Asia Compact Shelving
557
543
  easiacmx:
558
544
  specific_location: Van Pelt - East Asia Comics
559
545
  library: Van Pelt-Dietrich Library Center
@@ -576,40 +562,6 @@ edcomm:
576
562
  - Van Pelt-Dietrich Library Center
577
563
  - Education Commons
578
564
  display: Education Commons
579
- engi:
580
- specific_location: Engineering Library
581
- library: Engineering Library
582
- display: Engineering Library
583
- engicirc:
584
- specific_location: Engineering Library - Circulation Desk
585
- library: Engineering Library
586
- display: Engineering Library - Circulation Desk
587
- enginewbk:
588
- specific_location: Engineering Library - New Book
589
- library: Engineering Library
590
- display: Engineering Library - New Book
591
- engiperi:
592
- specific_location: Engineering Library - Periodicals
593
- library: Engineering Library
594
- display: Engineering Library - Periodicals (alphabetical by title)
595
- engirefe:
596
- specific_location: Engineering Library - Reference
597
- library: Engineering Library
598
- display: Engineering Library - Reference
599
- engirese:
600
- specific_location: Engineering Library - Reserve
601
- library:
602
- - Engineering Library
603
- - Reserve
604
- display: Engineering Library - Reserve
605
- engsc:
606
- specific_location: Engineering Library - Study Collection
607
- library: Engineering Library
608
- display: Engineering Library - Study Collection
609
- eres:
610
- specific_location:
611
- library:
612
- display: E-reserves
613
565
  fanewbook:
614
566
  specific_location: Fisher Fine Arts Library - New Book Display
615
567
  library: Fisher Fine Arts Library
@@ -684,10 +636,6 @@ finestudio:
684
636
  specific_location: Fisher Fine Arts Library - Studio Collection
685
637
  library: Fisher Fine Arts Library
686
638
  display: Fine Arts Library - Studio Collection
687
- HARR:
688
- specific_location:
689
- library:
690
- display:
691
639
  judaica:
692
640
  specific_location: Van Pelt - Judaica and Ancient Near East Resource Room
693
641
  library: Van Pelt-Dietrich Library Center
@@ -822,20 +770,6 @@ mideastres:
822
770
  - Van Pelt-Dietrich Library Center
823
771
  - Reserve
824
772
  display: Van Pelt - Middle East Seminar Reserve
825
- moor:
826
- specific_location: Engineering Library
827
- library: Engineering Library
828
- display: Engineering Library
829
- moorrefe:
830
- specific_location: Engineering Library - Reference
831
- library: Engineering Library
832
- display: Engineering Library - Reference
833
- moorrese:
834
- specific_location: Engineering Library - Reserve
835
- library:
836
- - Engineering Library
837
- - Reserve
838
- display: Engineering Library - Reserve
839
773
  muse:
840
774
  specific_location: Penn Museum Library
841
775
  library: Penn Museum Library
@@ -876,6 +810,10 @@ musemedia:
876
810
  specific_location: Penn Museum Library - Media
877
811
  library: Penn Museum Library
878
812
  display: Penn Museum Library - Media
813
+ musenewbk:
814
+ specific_location: Penn Museum Library - New Books Display
815
+ library: Penn Museum Library
816
+ display: Penn Museum Library - New Books Display
879
817
  muserefe:
880
818
  specific_location: Penn Museum Library - Reference
881
819
  library: Penn Museum Library
@@ -965,83 +903,6 @@ nursarch:
965
903
  specific_location: Nursing Archives
966
904
  library: Nursing Archives
967
905
  display: Barbara Bates Center for History of Nursing - Fagin Hall 2U
968
- oobiom:
969
- specific_location: On Order
970
- library:
971
- - Health Sciences Libraries
972
- - Holman Biotech Commons
973
- display: Ordered for Holman Biotech Commons
974
- oochem:
975
- specific_location: On Order
976
- library: Chemistry Library
977
- display: Ordered for Chemistry Library
978
- oocjs:
979
- specific_location: On Order
980
- library: Library at the Katz Center for Advanced Judaic Studies
981
- display: Ordered for Center for Judaic Studies Library
982
- oodental:
983
- specific_location: On Order
984
- library:
985
- - Health Sciences Libraries
986
- - Levy Dental Medicine Library
987
- display: Ordered for Levy Dental Medicine Library
988
- ooeastasia:
989
- specific_location: On Order
990
- library: Van Pelt-Dietrich Library Center
991
- display: Ordered for East Asia
992
- ooengi:
993
- specific_location: On Order
994
- library: Engineering Library
995
- display: Ordered for Engineering Library
996
- oofine:
997
- specific_location: On Order
998
- library: Fisher Fine Arts Library
999
- display: Ordered for Fine Arts Library
1000
- oolipp:
1001
- specific_location: On Order
1002
- library: Lippincott Library
1003
- display: Ordered for Lippincott Library
1004
- oomath:
1005
- specific_location: On Order
1006
- library: Math/Physics/Astronomy Library
1007
- display: Ordered for Math-Physics-Astronomy Library
1008
- oomuse:
1009
- specific_location: On Order
1010
- library: Penn Museum Library
1011
- display: Ordered for Museum Library
1012
- oomusic:
1013
- specific_location: On Order
1014
- library: Van Pelt-Dietrich Library Center
1015
- display: Ordered for Music Library
1016
- oonewbolt:
1017
- specific_location: On Order
1018
- library:
1019
- - Health Sciences Libraries
1020
- - Veterinary
1021
- - 'Veterinary: du Pont Library (New Bolton)'
1022
- display: Ordered for New Bolton Library
1023
- ooormandy:
1024
- specific_location: On Order
1025
- library: Van Pelt-Dietrich Library Center
1026
- display: Ordered for Ormandy Center
1027
- oostor:
1028
- specific_location: On Order
1029
- library: LIBRA
1030
- display: Ordered for LIBRA
1031
- oovanp:
1032
- specific_location: On Order
1033
- library: Van Pelt-Dietrich Library Center
1034
- display: Ordered for Van Pelt Library
1035
- oovete:
1036
- specific_location: On Order
1037
- library:
1038
- - Health Sciences Libraries
1039
- - Veterinary
1040
- display: 'Ordered for Veterinary: Atwood Library (Campus)'
1041
- ooyarn:
1042
- specific_location: On Order
1043
- library: Yarnall Collection
1044
- display: Ordered for Yarnall collection
1045
906
  pah:
1046
907
  specific_location: Pennsylvania Hospital Library
1047
908
  library:
@@ -1108,24 +969,6 @@ religious:
1108
969
  specific_location: Van Pelt - Medieval Studies Resource Room
1109
970
  library: Van Pelt-Dietrich Library Center
1110
971
  display: Van Pelt - Medieval Studies Resource Room (405)
1111
- rosedesk:
1112
- specific_location: Van Pelt - Rosengarten Reserve
1113
- library:
1114
- - Van Pelt-Dietrich Library Center
1115
- - Reserve
1116
- display: Van Pelt - Rosengarten Reserve Desk
1117
- roserefe:
1118
- specific_location: Van Pelt - Rosengarten Reserve
1119
- library:
1120
- - Van Pelt-Dietrich Library Center
1121
- - Reserve
1122
- display: Van Pelt - Rosengarten Reserve Reference
1123
- roserese:
1124
- specific_location: Van Pelt - Rosengarten Reserve
1125
- library:
1126
- - Van Pelt-Dietrich Library Center
1127
- - Reserve
1128
- display: Van Pelt - Rosengarten Reserve
1129
972
  rotc:
1130
973
  specific_location:
1131
974
  library:
@@ -1526,41 +1369,14 @@ scrunning:
1526
1369
  - Special Collections
1527
1370
  - LIBRA
1528
1371
  display: LIBRA Running Press Collection
1529
- sw3rdfl:
1530
- specific_location: Van Pelt - Temporarily shelved on third floor southwest corner
1531
- library: Van Pelt-Dietrich Library Center
1532
- display: Van Pelt - Temporarily shelved on third floor southwest corner
1533
- refsw3rdfl:
1534
- specific_location: Van Pelt - Temporarily shelved on third floor southwest reference
1535
- corner
1536
- library: Van Pelt-Dietrich Library Center
1537
- display: Van Pelt - Temporarily shelved on third floor southwest reference corner
1538
- town:
1539
- specific_location: Engineering Library
1540
- library: Engineering Library
1541
- display: Engineering Library
1542
- townrefe:
1543
- specific_location: Engineering Library - Reference
1544
- library: Engineering Library
1545
- display: Engineering Library - Reference
1546
- townrese:
1547
- specific_location: Engineering Library - Reserve
1548
- library:
1549
- - Engineering Library
1550
- - Reserve
1551
- display: Engineering Library - Reserve
1552
- townthes:
1553
- specific_location: Engineering Library - Theses
1554
- library: Engineering Library
1555
- display: Engineering Library - Theses
1556
- twcirc:
1557
- specific_location:
1558
- library: Engineering Library
1559
- display: Engineering Library - Circulation Desk
1560
1372
  univarch:
1561
1373
  specific_location: University Archives
1562
1374
  library: University Archives
1563
1375
  display: University Archives
1376
+ RDDSXBooks:
1377
+ specific_location: Van Pelt - RDDSX Books
1378
+ library: Van Pelt-Dietrich Library Center
1379
+ display: Van Pelt - RDDSX Books
1564
1380
  vanp:
1565
1381
  specific_location: Van Pelt - Stacks
1566
1382
  library: Van Pelt-Dietrich Library Center
@@ -1577,14 +1393,14 @@ vanpcgc:
1577
1393
  specific_location: Van Pelt - Center for Global Collections
1578
1394
  library: Van Pelt-Dietrich Library Center
1579
1395
  display: Van Pelt - Center for Global Collections
1396
+ vanpcgccm:
1397
+ specific_location: Van Pelt - Global Comics Collection
1398
+ library: Van Pelt-Dietrich Library Center
1399
+ display: Van Pelt - Global Comics Collection
1580
1400
  vanpmicro:
1581
1401
  specific_location: Van Pelt - Microtext
1582
1402
  library: Van Pelt-Dietrich Library Center
1583
1403
  display: Van Pelt - Microtext
1584
- vanpmiddle:
1585
- specific_location:
1586
- library:
1587
- display: Van Pelt - Middle East Tech Services
1588
1404
  vanpNoCirc:
1589
1405
  specific_location: Van Pelt - Non Circulating
1590
1406
  library: Van Pelt-Dietrich Library Center
@@ -1798,4 +1614,4 @@ hspref:
1798
1614
  hspstafref:
1799
1615
  specific_location: Historical Society of Pennsylvania - Staff Reference
1800
1616
  library: Historical Society of Pennsylvania
1801
- display: Historical Society of Pennsylvania - Staff Reference
1617
+ display: Historical Society of Pennsylvania - Staff Reference
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PennMARC
4
- VERSION = '1.0.10'
4
+ VERSION = '1.0.11.pre1'
5
5
  end
data/pennmarc.gemspec CHANGED
@@ -23,5 +23,5 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency 'marc', '~> 1.2'
24
24
  s.add_dependency 'nokogiri', '~> 1.15'
25
25
 
26
- s.metadata['rubygems_mfa_required'] = 'true'
26
+ s.metadata['rubygems_mfa_required'] = 'false'
27
27
  end
@@ -18,7 +18,7 @@ describe 'PennMARC::Access' do
18
18
  end
19
19
 
20
20
  context 'with enrichment with availability info via the Alma API' do
21
- let(:tag) { PennMARC::Access::ELEC_AVAILABILITY_TAG }
21
+ let(:tag) { PennMARC::EnrichedMarc::AlmaApi::TAG_ELECTRONIC_INVENTORY }
22
22
 
23
23
  it 'returns expected access value' do
24
24
  expect(helper.facet(record)).to contain_exactly(PennMARC::Access::ONLINE)
@@ -38,7 +38,7 @@ describe 'PennMARC::Access' do
38
38
  end
39
39
 
40
40
  context 'with enrichment with availability info via the Alma API' do
41
- let(:tag) { PennMARC::Access::PHYS_AVAILABILITY_TAG }
41
+ let(:tag) { PennMARC::EnrichedMarc::AlmaApi::TAG_PHYSICAL_INVENTORY }
42
42
 
43
43
  it 'returns expected access value' do
44
44
  expect(helper.facet(record)).to contain_exactly(PennMARC::Access::AT_THE_LIBRARY)
@@ -60,18 +60,38 @@ describe 'PennMARC::Format' do
60
60
  end
61
61
 
62
62
  it 'returns a facet value of only "Microformat"' do
63
- # expect(formats).to eq %w[Microformat Thesis/Dissertation]
64
63
  expect(formats).to eq %w[Microformat]
65
64
  end
66
65
  end
67
66
 
68
67
  context 'with Microformats as determined by the holding call numbers' do
69
- let(:record) do
70
- marc_record fields: [marc_field(tag: 'hld', subfields: { h: 'AB123', i: '.456 Microfilm' })]
68
+ context 'with API enriched fields' do
69
+ let(:record) do
70
+ marc_record fields: [
71
+ marc_field(tag: PennMARC::EnrichedMarc::AlmaApi::TAG_PHYSICAL_INVENTORY, subfields: {
72
+ :h => 'AB123',
73
+ PennMARC::EnrichedMarc::AlmaApi::SUB_PHYSICAL_CALL_NUMBER_TYPE => '.456 Microfilm'
74
+ })
75
+ ]
76
+ end
77
+
78
+ it 'returns a facet value of "Microformat"' do
79
+ expect(formats).to eq ['Microformat']
80
+ end
71
81
  end
72
82
 
73
- it 'returns a facet value of "Microformat"' do
74
- expect(formats).to eq ['Microformat']
83
+ context 'with publishing enriched fields' do
84
+ let(:record) do
85
+ marc_record fields: [
86
+ marc_field(tag: PennMARC::EnrichedMarc::TAG_HOLDING,
87
+ subfields: { :h => 'AB123',
88
+ PennMARC::EnrichedMarc::SUB_ITEM_CALL_NUMBER_TYPE => '.456 Microfilm' })
89
+ ]
90
+ end
91
+
92
+ it 'returns a facet value of "Microformat"' do
93
+ expect(formats).to eq ['Microformat']
94
+ end
75
95
  end
76
96
  end
77
97
 
@@ -15,8 +15,8 @@ describe 'PennMARC::Link' do
15
15
  end
16
16
 
17
17
  it 'returns full text link text and url' do
18
- expect(helper.full_text_link(record)).to contain_exactly({ link_text: 'Materials specified Public note',
19
- link_url: 'https://www.test-uri.com/' })
18
+ expect(helper.full_text_links(record)).to contain_exactly({ link_text: 'Materials specified Public note',
19
+ link_url: 'https://www.test-uri.com/' })
20
20
  end
21
21
  end
22
22
 
@@ -30,8 +30,8 @@ describe 'PennMARC::Link' do
30
30
  end
31
31
 
32
32
  it 'returns web link text and url' do
33
- expect(helper.web_link(record)).to contain_exactly({ link_text: 'Materials specified Public note',
34
- link_url: 'https://www.test-uri.com/' })
33
+ expect(helper.web_links(record)).to contain_exactly({ link_text: 'Materials specified Public note',
34
+ link_url: 'https://www.test-uri.com/' })
35
35
  end
36
36
  end
37
37
  end
@@ -67,5 +67,17 @@ describe 'PennMARC::Location' do
67
67
  display_value: :library)).to contain_exactly('LIBRA', 'Online library')
68
68
  end
69
69
  end
70
+
71
+ context 'with AVA fields' do
72
+ let(:record) do
73
+ marc_record(fields: [marc_field(tag: 'AVA', subfields: { b: 'Libra', c: 'LIBRA', j: 'stor' })])
74
+ end
75
+
76
+ it 'returns expected values' do
77
+ expect(helper.location(record: record, location_map: mapping, display_value: :library)).to(
78
+ contain_exactly('LIBRA')
79
+ )
80
+ end
81
+ end
70
82
  end
71
83
  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.10
4
+ version: 1.0.11.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Kanning
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-12-20 00:00:00.000000000 Z
13
+ date: 2024-01-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -77,6 +77,7 @@ extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
79
  - ".gitignore"
80
+ - ".gitlab-ci.yml"
80
81
  - ".gitleaks.toml"
81
82
  - ".rspec"
82
83
  - ".rubocop.yml"
@@ -148,7 +149,7 @@ homepage: https://gitlab.library.upenn.edu/dld/catalog/pennmarc
148
149
  licenses:
149
150
  - MIT
150
151
  metadata:
151
- rubygems_mfa_required: 'true'
152
+ rubygems_mfa_required: 'false'
152
153
  post_install_message:
153
154
  rdoc_options: []
154
155
  require_paths:
@@ -160,9 +161,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
161
  version: '3.2'
161
162
  required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  requirements:
163
- - - ">="
164
+ - - ">"
164
165
  - !ruby/object:Gem::Version
165
- version: '0'
166
+ version: 1.3.1
166
167
  requirements: []
167
168
  rubygems_version: 3.4.10
168
169
  signing_key: