pennmarc 1.2.4 → 1.2.5
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/.gitlab-ci.yml +26 -57
- data/.pipeline.yml +64 -0
- data/lib/pennmarc/helpers/relation.rb +10 -0
- data/lib/pennmarc/mappings/locations.yml +17 -1
- data/lib/pennmarc/version.rb +1 -1
- data/spec/lib/pennmarc/helpers/relation_spec.rb +10 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21463a3d231e3ba853929bc03241d8e3c109c6191d3a5747c1a397aad40e454d
|
|
4
|
+
data.tar.gz: e747a26ee6ed508b13a3079acd2291d194d4a9a9bc4a984dcefd8145d5f76084
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee0a42b85b4862caca7417176947497d63253d07818341e3ef483789554dfcf06eff4f658a89d44d865e7354f4dcae3e88e060cdd41c941e016de5d86e8ad365
|
|
7
|
+
data.tar.gz: ca200369654cb607e14ea1225ce785a90ca05da9f5fe9a3a7390748b997b4b5e423f26a1c832bfab14c339a493af39f2422171b647542f92a926e5c2a7405993
|
data/.gitlab-ci.yml
CHANGED
|
@@ -1,65 +1,34 @@
|
|
|
1
|
+
---
|
|
1
2
|
include:
|
|
2
|
-
-
|
|
3
|
-
file:
|
|
4
|
-
- ".install_hashicorp_vault.yml"
|
|
5
|
-
- ".vault_jwt_auth.yml"
|
|
6
|
-
- project: "devops/gitlab/ci-templates/ruby"
|
|
7
|
-
ref: "sans-dind"
|
|
8
|
-
file:
|
|
9
|
-
- ".rspec.yml"
|
|
10
|
-
- ".rubocop.yml"
|
|
11
|
-
- template: "Workflows/MergeRequest-Pipelines.gitlab-ci.yml"
|
|
3
|
+
- template: Jobs/Secret-Detection.gitlab-ci.yml
|
|
12
4
|
|
|
13
5
|
stages:
|
|
14
|
-
-
|
|
15
|
-
-
|
|
6
|
+
- secret_check
|
|
7
|
+
- main_pipeline
|
|
16
8
|
|
|
17
|
-
|
|
18
|
-
stage:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
tags:
|
|
25
|
-
- build
|
|
26
|
-
|
|
27
|
-
rubocop_app_test:
|
|
28
|
-
stage: test
|
|
29
|
-
image: ruby:3.2.2
|
|
30
|
-
before_script:
|
|
31
|
-
- bundle install -j $(nproc)
|
|
32
|
-
extends:
|
|
33
|
-
- .rubocop
|
|
9
|
+
secret_detection:
|
|
10
|
+
stage: secret_check
|
|
11
|
+
allow_failure: false
|
|
12
|
+
artifacts:
|
|
13
|
+
paths:
|
|
14
|
+
- .pipeline.yml
|
|
15
|
+
expire_in: 1 day
|
|
34
16
|
tags:
|
|
35
17
|
- build
|
|
18
|
+
rules:
|
|
19
|
+
- when: always
|
|
36
20
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- export GEM_HOST_API_KEY="$(vault kv get -field=rubygems_api_key ${VAULT_KV_ENDPOINT}${ENVIRONMENT})"
|
|
48
|
-
- |
|
|
49
|
-
gem -v
|
|
50
|
-
rm -f ./*.gem
|
|
51
|
-
[ -f "${GEMSPEC_FILE}" ] || (echo "No ${GEMSPEC_FILE} file found!" && exit 1)
|
|
52
|
-
- '[ -n "${GEM_HOST_API_KEY}" ] || (echo "GEM_HOST_API_KEY is not set!" && exit 1)'
|
|
53
|
-
script:
|
|
54
|
-
- GEM_FILE=$(echo "${CI_PROJECT_NAME}-${CI_COMMIT_TAG:1}.gem")
|
|
55
|
-
- |
|
|
56
|
-
gem build "${GEMSPEC_FILE}"
|
|
57
|
-
[ -f "${GEM_FILE}" ] || (echo "No ${GEM_FILE} file found!" && exit 1)
|
|
58
|
-
- '[ "${DISABLE_GEM_PUSH}" == "true" ] || gem push "${GEM_FILE}"'
|
|
21
|
+
main:
|
|
22
|
+
stage: main_pipeline
|
|
23
|
+
needs:
|
|
24
|
+
- secret_detection
|
|
25
|
+
allow_failure: false
|
|
26
|
+
trigger:
|
|
27
|
+
include:
|
|
28
|
+
- artifact: .pipeline.yml
|
|
29
|
+
job: secret_detection
|
|
30
|
+
strategy: depend
|
|
59
31
|
rules:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
- "*.gem"
|
|
64
|
-
tags:
|
|
65
|
-
- deploy
|
|
32
|
+
- if: "$CI_MERGE_REQUEST_IID"
|
|
33
|
+
- if: "$CI_COMMIT_TAG"
|
|
34
|
+
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
|
data/.pipeline.yml
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
include:
|
|
2
|
+
- project: "devops/gitlab/ci-templates/general"
|
|
3
|
+
file:
|
|
4
|
+
- ".install_hashicorp_vault.yml"
|
|
5
|
+
- ".vault_jwt_auth.yml"
|
|
6
|
+
- project: "devops/gitlab/ci-templates/ruby"
|
|
7
|
+
ref: "sans-dind"
|
|
8
|
+
file:
|
|
9
|
+
- ".rspec.yml"
|
|
10
|
+
- ".rubocop.yml"
|
|
11
|
+
|
|
12
|
+
stages:
|
|
13
|
+
- test
|
|
14
|
+
- deploy
|
|
15
|
+
|
|
16
|
+
rspec_app_test:
|
|
17
|
+
stage: test
|
|
18
|
+
image: ruby:3.2.2
|
|
19
|
+
before_script:
|
|
20
|
+
- bundle install -j $(nproc)
|
|
21
|
+
extends:
|
|
22
|
+
- .rspec
|
|
23
|
+
tags:
|
|
24
|
+
- build
|
|
25
|
+
|
|
26
|
+
rubocop_app_test:
|
|
27
|
+
stage: test
|
|
28
|
+
image: ruby:3.2.2
|
|
29
|
+
before_script:
|
|
30
|
+
- bundle install -j $(nproc)
|
|
31
|
+
extends:
|
|
32
|
+
- .rubocop
|
|
33
|
+
tags:
|
|
34
|
+
- build
|
|
35
|
+
|
|
36
|
+
# This step was inspired from Gitlab's example of gem publication:
|
|
37
|
+
# https://gitlab.com/gitlab-org/quality/pipeline-common/-/blob/master/ci/gem-release.yml
|
|
38
|
+
gem_publication:
|
|
39
|
+
stage: deploy
|
|
40
|
+
image: ruby:3.2.2
|
|
41
|
+
variables:
|
|
42
|
+
GEMSPEC_FILE: "${CI_PROJECT_NAME}.gemspec"
|
|
43
|
+
before_script:
|
|
44
|
+
- !reference [.install_hashicorp_vault, before_script]
|
|
45
|
+
- !reference [.vault_jwt_auth, before_script]
|
|
46
|
+
- export GEM_HOST_API_KEY="$(vault kv get -field=rubygems_api_key ${VAULT_KV_ENDPOINT}${ENVIRONMENT})"
|
|
47
|
+
- |
|
|
48
|
+
gem -v
|
|
49
|
+
rm -f ./*.gem
|
|
50
|
+
[ -f "${GEMSPEC_FILE}" ] || (echo "No ${GEMSPEC_FILE} file found!" && exit 1)
|
|
51
|
+
- '[ -n "${GEM_HOST_API_KEY}" ] || (echo "GEM_HOST_API_KEY is not set!" && exit 1)'
|
|
52
|
+
script:
|
|
53
|
+
- GEM_FILE=$(echo "${CI_PROJECT_NAME}-${CI_COMMIT_TAG:1}.gem")
|
|
54
|
+
- |
|
|
55
|
+
gem build "${GEMSPEC_FILE}"
|
|
56
|
+
[ -f "${GEM_FILE}" ] || (echo "No ${GEM_FILE} file found!" && exit 1)
|
|
57
|
+
- '[ "${DISABLE_GEM_PUSH}" == "true" ] || gem push "${GEM_FILE}"'
|
|
58
|
+
rules:
|
|
59
|
+
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+(\.[a-zA-Z0-9]+)?$/
|
|
60
|
+
artifacts:
|
|
61
|
+
paths:
|
|
62
|
+
- "*.gem"
|
|
63
|
+
tags:
|
|
64
|
+
- deploy
|
|
@@ -21,6 +21,16 @@ module PennMARC
|
|
|
21
21
|
}.uniq
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Get "Contained in" values from {https://www.oclc.org/bibformats/en/7xx/773.html MARC 773}
|
|
25
|
+
# subfield g for related parts.
|
|
26
|
+
# @param record [MARC::Record]
|
|
27
|
+
# @return [Array<String>] related parts values for display
|
|
28
|
+
def contained_in_related_parts_show(record)
|
|
29
|
+
record.fields('773').map { |field|
|
|
30
|
+
join_subfields(field, &subfield_in?(%w[g]))
|
|
31
|
+
}.uniq
|
|
32
|
+
end
|
|
33
|
+
|
|
24
34
|
# Get "chronology" information from specially-prefixed 650 (subject) fields
|
|
25
35
|
# @todo why do we stuff chronology data in a 650 field?
|
|
26
36
|
# @param record [MARC::Record]
|
|
@@ -840,6 +840,10 @@ mideastres:
|
|
|
840
840
|
- Van Pelt-Dietrich Library Center
|
|
841
841
|
- Reserve
|
|
842
842
|
display: Van Pelt - Middle East Seminar Reserve
|
|
843
|
+
mscirc:
|
|
844
|
+
specific_location: Penn Museum Library - Circulation
|
|
845
|
+
library: Penn Museum Library
|
|
846
|
+
display: Penn Museum Library - Circulation
|
|
843
847
|
muse:
|
|
844
848
|
specific_location: Penn Museum Library
|
|
845
849
|
library: Penn Museum Library
|
|
@@ -867,6 +871,14 @@ museegypov:
|
|
|
867
871
|
specific_location: Penn Museum Library - Egyptian Oversize
|
|
868
872
|
library: Penn Museum Library
|
|
869
873
|
display: Penn Museum Library - Egyptian Oversize
|
|
874
|
+
museexhi:
|
|
875
|
+
specific_location: Penn Museum Library - Exhibition
|
|
876
|
+
library: Penn Museum Library
|
|
877
|
+
display: Penn Museum Library - Exhibition
|
|
878
|
+
musefolio:
|
|
879
|
+
specific_location: Penn Museum Library - Folio
|
|
880
|
+
library: Penn Museum Library
|
|
881
|
+
display: Penn Museum Library - Folio
|
|
870
882
|
musekolb:
|
|
871
883
|
specific_location: Penn Museum Library - Kolb
|
|
872
884
|
library: Penn Museum Library
|
|
@@ -882,10 +894,14 @@ musemedia:
|
|
|
882
894
|
specific_location: Penn Museum Library - Media
|
|
883
895
|
library: Penn Museum Library
|
|
884
896
|
display: Penn Museum Library - Media
|
|
885
|
-
|
|
897
|
+
musenewbks:
|
|
886
898
|
specific_location: Penn Museum Library - New Books Display
|
|
887
899
|
library: Penn Museum Library
|
|
888
900
|
display: Penn Museum Library - New Books Display
|
|
901
|
+
museover:
|
|
902
|
+
specific_location: Penn Museum Library - Oversize
|
|
903
|
+
library: Penn Museum Library
|
|
904
|
+
display: Penn Museum Library - Oversize
|
|
889
905
|
muserefe:
|
|
890
906
|
specific_location: Penn Museum Library - Reference
|
|
891
907
|
library: Penn Museum Library
|
data/lib/pennmarc/version.rb
CHANGED
|
@@ -16,6 +16,16 @@ describe 'PennMARC::Relation' do
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
describe '.contained_in_related_parts_show' do
|
|
20
|
+
let(:fields) do
|
|
21
|
+
[marc_field(tag: '773', subfields: { g: 'Vol. 24, pt. B no. 9 (Sept. 1993)', q: '24:B:9<235' })]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'returns only the specified subfields' do
|
|
25
|
+
expect(helper.contained_in_related_parts_show(record)).to eq ['Vol. 24, pt. B no. 9 (Sept. 1993)']
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
19
29
|
describe '.chronology_show' do
|
|
20
30
|
let(:fields) do
|
|
21
31
|
[marc_field(tag: '650', indicator2: '4', subfields: { a: 'CHR Heading' }),
|
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.5
|
|
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-12-
|
|
15
|
+
date: 2024-12-17 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: activesupport
|
|
@@ -81,6 +81,7 @@ files:
|
|
|
81
81
|
- ".gitignore"
|
|
82
82
|
- ".gitlab-ci.yml"
|
|
83
83
|
- ".gitleaks.toml"
|
|
84
|
+
- ".pipeline.yml"
|
|
84
85
|
- ".rspec"
|
|
85
86
|
- ".rubocop.yml"
|
|
86
87
|
- ".rubocop_todo.yml"
|