berkeley_library-alma 0.0.7.1 → 0.1.1

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: 75af9a35d41937d5f783bb9ef9bca06e2896692b17289ed2d226213268525b8d
4
- data.tar.gz: a19bf19c4d06f4453f1a1deab67967f9a8109e558e3f93a3222232bcf131dd8e
3
+ metadata.gz: dbd49987e828ce94bb8031f580643a732423da69771f24e14fc6787a6b5f1185
4
+ data.tar.gz: 2012e2a762b2f95509d46d6f490fe988833432f51dc0b4540801cb9bc039cfed
5
5
  SHA512:
6
- metadata.gz: 15a42332adcabc623f442b8dbe9139fc81eecf4a724dae5b7c6f59e9f3dea6611de8901105eea70391f7921440020e5042db71c569b65fb4fb95b09c5106a1f1
7
- data.tar.gz: 60fa24417122d3847c89013c0d0b7d20cee77953d87170b515b1b25f6635a279166acf7f8e76b1f6e1f322f7a7c7c351de51f5d6f92fec8c5834a116710ada49
6
+ metadata.gz: 746e3c85182bb532ec1169ddecfa127e824a14676d9728c1d5594158e035e741fa05826ae76d3aacea6f81f87c871caff6b034fdcbcdb7f9f3c2202676b715cc
7
+ data.tar.gz: 963d161963b99a8e208b785ae06f746d77535cc445a95831154a63af5938f5461e13d032113d1a99aa03c3defacd239baede86dc9d9ddc15149729d9fe419c67
@@ -1,18 +1,30 @@
1
1
  name: Build
2
- on: [ push, pull_request ]
2
+ on: [ push, pull_request, workflow_dispatch ]
3
3
  jobs:
4
4
  test:
5
5
  strategy:
6
6
  fail-fast: false
7
7
  matrix:
8
8
  os: [ ubuntu-latest, macos-latest ]
9
- ruby: [ '2.7', '3.0' ]
9
+ ruby: [ '3.3', '3.4' ]
10
10
  runs-on: ${{ matrix.os }}
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@v2
14
- - uses: ruby/setup-ruby@v1
13
+ - name: Check out repository
14
+ uses: actions/checkout@v2
15
+
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@v1
15
18
  with:
16
19
  ruby-version: ${{ matrix.ruby }}
17
20
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
18
- - run: bundle exec rake
21
+
22
+ - name: Run checks
23
+ run: bundle exec rake
24
+
25
+ - name: Upload artifacts
26
+ if: ${{ always() }}
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: artifacts-${{ matrix.ruby }}-${{ matrix.os }}
30
+ path: artifacts/**
@@ -0,0 +1,33 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build + Publish
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ packages: write
14
+
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: '3.3'
22
+ bundler-cache: true
23
+
24
+ - name: Publish to RubyGems
25
+ run: |
26
+ mkdir -p $HOME/.gem
27
+ touch $HOME/.gem/credentials
28
+ chmod 0600 $HOME/.gem/credentials
29
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
30
+ gem build *.gemspec
31
+ gem push *.gem
32
+ env:
33
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
data/.idea/alma.iml CHANGED
@@ -12,19 +12,19 @@
12
12
  </content>
13
13
  <orderEntry type="jdk" jdkName="RVM: ruby-2.7.5" jdkType="RUBY_SDK" />
14
14
  <orderEntry type="sourceFolder" forTests="false" />
15
- <orderEntry type="library" scope="PROVIDED" name="actionpack (v7.0.2.4, RVM: ruby-2.7.5) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="actionview (v7.0.2.4, RVM: ruby-2.7.5) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="activesupport (v7.0.2.4, RVM: ruby-2.7.5) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="addressable (v2.8.0, RVM: ruby-2.7.5) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="actionpack (v7.0.4, RVM: ruby-2.7.5) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="actionview (v7.0.4, RVM: ruby-2.7.5) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="activesupport (v7.0.4, RVM: ruby-2.7.5) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="addressable (v2.8.1, RVM: ruby-2.7.5) [gem]" level="application" />
19
19
  <orderEntry type="library" scope="PROVIDED" name="amazing_print (v1.4.0, RVM: ruby-2.7.5) [gem]" level="application" />
20
20
  <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, RVM: ruby-2.7.5) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="berkeley_library-logging (v0.2.6, RVM: ruby-2.7.5) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="berkeley_library-logging (v0.2.7, RVM: ruby-2.7.5) [gem]" level="application" />
22
22
  <orderEntry type="library" scope="PROVIDED" name="berkeley_library-marc (v0.3.1, RVM: ruby-2.7.5) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="berkeley_library-util (v0.1.2, RVM: ruby-2.7.5) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="berkeley_library-util (v0.1.5, RVM: ruby-2.7.5) [gem]" level="application" />
24
24
  <orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, RVM: ruby-2.7.5) [gem]" level="application" />
25
25
  <orderEntry type="library" scope="PROVIDED" name="bundle-audit (v0.1.0, RVM: ruby-2.7.5) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, RVM: ruby-2.7.5) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="bundler-audit (v0.9.0.1, RVM: ruby-2.7.5) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.31, RVM: ruby-2.7.5) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="bundler-audit (v0.9.1, RVM: ruby-2.7.5) [gem]" level="application" />
28
28
  <orderEntry type="library" scope="PROVIDED" name="ci_reporter (v2.0.0, RVM: ruby-2.7.5) [gem]" level="application" />
29
29
  <orderEntry type="library" scope="PROVIDED" name="ci_reporter_rspec (v1.0.0, RVM: ruby-2.7.5) [gem]" level="application" />
30
30
  <orderEntry type="library" scope="PROVIDED" name="colorize (v0.8.1, RVM: ruby-2.7.5) [gem]" level="application" />
@@ -34,45 +34,46 @@
34
34
  <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, RVM: ruby-2.7.5) [gem]" level="application" />
35
35
  <orderEntry type="library" scope="PROVIDED" name="docile (v1.4.0, RVM: ruby-2.7.5) [gem]" level="application" />
36
36
  <orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.20190701, RVM: ruby-2.7.5) [gem]" level="application" />
37
- <orderEntry type="library" scope="PROVIDED" name="erubi (v1.10.0, RVM: ruby-2.7.5) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="erubi (v1.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
38
38
  <orderEntry type="library" scope="PROVIDED" name="hashdiff (v1.0.1, RVM: ruby-2.7.5) [gem]" level="application" />
39
39
  <orderEntry type="library" scope="PROVIDED" name="http-accept (v1.7.0, RVM: ruby-2.7.5) [gem]" level="application" />
40
- <orderEntry type="library" scope="PROVIDED" name="http-cookie (v1.0.4, RVM: ruby-2.7.5) [gem]" level="application" />
41
- <orderEntry type="library" scope="PROVIDED" name="i18n (v1.10.0, RVM: ruby-2.7.5) [gem]" level="application" />
40
+ <orderEntry type="library" scope="PROVIDED" name="http-cookie (v1.0.5, RVM: ruby-2.7.5) [gem]" level="application" />
41
+ <orderEntry type="library" scope="PROVIDED" name="i18n (v1.12.0, RVM: ruby-2.7.5) [gem]" level="application" />
42
+ <orderEntry type="library" scope="PROVIDED" name="json (v2.6.2, RVM: ruby-2.7.5) [gem]" level="application" />
42
43
  <orderEntry type="library" scope="PROVIDED" name="lograge (v0.12.0, RVM: ruby-2.7.5) [gem]" level="application" />
43
- <orderEntry type="library" scope="PROVIDED" name="loofah (v2.17.0, RVM: ruby-2.7.5) [gem]" level="application" />
44
- <orderEntry type="library" scope="PROVIDED" name="marc (v1.1.1, RVM: ruby-2.7.5) [gem]" level="application" />
44
+ <orderEntry type="library" scope="PROVIDED" name="loofah (v2.19.0, RVM: ruby-2.7.5) [gem]" level="application" />
45
+ <orderEntry type="library" scope="PROVIDED" name="marc (v1.2.0, RVM: ruby-2.7.5) [gem]" level="application" />
45
46
  <orderEntry type="library" scope="PROVIDED" name="method_source (v1.0.0, RVM: ruby-2.7.5) [gem]" level="application" />
46
47
  <orderEntry type="library" scope="PROVIDED" name="mime-types (v3.4.1, RVM: ruby-2.7.5) [gem]" level="application" />
47
48
  <orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2022.0105, RVM: ruby-2.7.5) [gem]" level="application" />
48
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.15.0, RVM: ruby-2.7.5) [gem]" level="application" />
49
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.16.3, RVM: ruby-2.7.5) [gem]" level="application" />
49
50
  <orderEntry type="library" scope="PROVIDED" name="netrc (v0.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
50
- <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.13.5, RVM: ruby-2.7.5) [gem]" level="application" />
51
- <orderEntry type="library" scope="PROVIDED" name="oj (v3.13.11, RVM: ruby-2.7.5) [gem]" level="application" />
51
+ <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.13.9, RVM: ruby-2.7.5) [gem]" level="application" />
52
+ <orderEntry type="library" scope="PROVIDED" name="oj (v3.13.23, RVM: ruby-2.7.5) [gem]" level="application" />
52
53
  <orderEntry type="library" scope="PROVIDED" name="ougai (v1.9.1, RVM: ruby-2.7.5) [gem]" level="application" />
53
- <orderEntry type="library" scope="PROVIDED" name="parallel (v1.21.0, RVM: ruby-2.7.5) [gem]" level="application" />
54
- <orderEntry type="library" scope="PROVIDED" name="parser (v3.1.0.0, RVM: ruby-2.7.5) [gem]" level="application" />
54
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, RVM: ruby-2.7.5) [gem]" level="application" />
55
+ <orderEntry type="library" scope="PROVIDED" name="parser (v3.1.2.1, RVM: ruby-2.7.5) [gem]" level="application" />
55
56
  <orderEntry type="library" scope="PROVIDED" name="parslet (v2.0.0, RVM: ruby-2.7.5) [gem]" level="application" />
56
- <orderEntry type="library" scope="PROVIDED" name="public_suffix (v4.0.6, RVM: ruby-2.7.5) [gem]" level="application" />
57
+ <orderEntry type="library" scope="PROVIDED" name="public_suffix (v5.0.0, RVM: ruby-2.7.5) [gem]" level="application" />
57
58
  <orderEntry type="library" scope="PROVIDED" name="racc (v1.6.0, RVM: ruby-2.7.5) [gem]" level="application" />
58
- <orderEntry type="library" scope="PROVIDED" name="rack (v2.2.3, RVM: ruby-2.7.5) [gem]" level="application" />
59
- <orderEntry type="library" scope="PROVIDED" name="rack-test (v1.1.0, RVM: ruby-2.7.5) [gem]" level="application" />
59
+ <orderEntry type="library" scope="PROVIDED" name="rack (v2.2.4, RVM: ruby-2.7.5) [gem]" level="application" />
60
+ <orderEntry type="library" scope="PROVIDED" name="rack-test (v2.0.2, RVM: ruby-2.7.5) [gem]" level="application" />
60
61
  <orderEntry type="library" scope="PROVIDED" name="rails-dom-testing (v2.0.3, RVM: ruby-2.7.5) [gem]" level="application" />
61
- <orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.4.2, RVM: ruby-2.7.5) [gem]" level="application" />
62
- <orderEntry type="library" scope="PROVIDED" name="railties (v7.0.2.4, RVM: ruby-2.7.5) [gem]" level="application" />
62
+ <orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.4.3, RVM: ruby-2.7.5) [gem]" level="application" />
63
+ <orderEntry type="library" scope="PROVIDED" name="railties (v7.0.4, RVM: ruby-2.7.5) [gem]" level="application" />
63
64
  <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, RVM: ruby-2.7.5) [gem]" level="application" />
64
65
  <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, RVM: ruby-2.7.5) [gem]" level="application" />
65
- <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.2.0, RVM: ruby-2.7.5) [gem]" level="application" />
66
+ <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.6.0, RVM: ruby-2.7.5) [gem]" level="application" />
66
67
  <orderEntry type="library" scope="PROVIDED" name="request_store (v1.5.1, RVM: ruby-2.7.5) [gem]" level="application" />
67
68
  <orderEntry type="library" scope="PROVIDED" name="rest-client (v2.1.0, RVM: ruby-2.7.5) [gem]" level="application" />
68
69
  <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, RVM: ruby-2.7.5) [gem]" level="application" />
69
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
70
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
71
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
72
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
73
- <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
74
- <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.11.0, RVM: ruby-2.7.5) [gem]" level="application" />
75
- <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.15.1, RVM: ruby-2.7.5) [gem]" level="application" />
70
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.12.0, RVM: ruby-2.7.5) [gem]" level="application" />
71
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.12.0, RVM: ruby-2.7.5) [gem]" level="application" />
72
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.12.0, RVM: ruby-2.7.5) [gem]" level="application" />
73
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.12.0, RVM: ruby-2.7.5) [gem]" level="application" />
74
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.12.0, RVM: ruby-2.7.5) [gem]" level="application" />
75
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.39.0, RVM: ruby-2.7.5) [gem]" level="application" />
76
+ <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.23.0, RVM: ruby-2.7.5) [gem]" level="application" />
76
77
  <orderEntry type="library" scope="PROVIDED" name="rubocop-rake (v0.6.0, RVM: ruby-2.7.5) [gem]" level="application" />
77
78
  <orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v2.4.0, RVM: ruby-2.7.5) [gem]" level="application" />
78
79
  <orderEntry type="library" scope="PROVIDED" name="ruby-marc-spec (v0.1.3, RVM: ruby-2.7.5) [gem]" level="application" />
@@ -80,18 +81,18 @@
80
81
  <orderEntry type="library" scope="PROVIDED" name="scrub_rb (v1.0.1, RVM: ruby-2.7.5) [gem]" level="application" />
81
82
  <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.21.2, RVM: ruby-2.7.5) [gem]" level="application" />
82
83
  <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.12.3, RVM: ruby-2.7.5) [gem]" level="application" />
83
- <orderEntry type="library" scope="PROVIDED" name="simplecov-rcov (v0.2.3, RVM: ruby-2.7.5) [gem]" level="application" />
84
- <orderEntry type="library" scope="PROVIDED" name="simplecov_json_formatter (v0.1.3, RVM: ruby-2.7.5) [gem]" level="application" />
84
+ <orderEntry type="library" scope="PROVIDED" name="simplecov-rcov (v0.3.1, RVM: ruby-2.7.5) [gem]" level="application" />
85
+ <orderEntry type="library" scope="PROVIDED" name="simplecov_json_formatter (v0.1.4, RVM: ruby-2.7.5) [gem]" level="application" />
85
86
  <orderEntry type="library" scope="PROVIDED" name="thor (v1.2.1, RVM: ruby-2.7.5) [gem]" level="application" />
86
- <orderEntry type="library" scope="PROVIDED" name="typesafe_enum (v0.3.0, RVM: ruby-2.7.5) [gem]" level="application" />
87
- <orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.4, RVM: ruby-2.7.5) [gem]" level="application" />
87
+ <orderEntry type="library" scope="PROVIDED" name="typesafe_enum (v0.3.1, RVM: ruby-2.7.5) [gem]" level="application" />
88
+ <orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.5, RVM: ruby-2.7.5) [gem]" level="application" />
88
89
  <orderEntry type="library" scope="PROVIDED" name="unf (v0.1.4, RVM: ruby-2.7.5) [gem]" level="application" />
89
- <orderEntry type="library" scope="PROVIDED" name="unf_ext (v0.0.8.1, RVM: ruby-2.7.5) [gem]" level="application" />
90
- <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, RVM: ruby-2.7.5) [gem]" level="application" />
91
- <orderEntry type="library" scope="PROVIDED" name="webmock (v3.14.0, RVM: ruby-2.7.5) [gem]" level="application" />
90
+ <orderEntry type="library" scope="PROVIDED" name="unf_ext (v0.0.8.2, RVM: ruby-2.7.5) [gem]" level="application" />
91
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.3.0, RVM: ruby-2.7.5) [gem]" level="application" />
92
+ <orderEntry type="library" scope="PROVIDED" name="webmock (v3.18.1, RVM: ruby-2.7.5) [gem]" level="application" />
92
93
  <orderEntry type="library" scope="PROVIDED" name="webrick (v1.7.0, RVM: ruby-2.7.5) [gem]" level="application" />
93
- <orderEntry type="library" scope="PROVIDED" name="yard (v0.9.27, RVM: ruby-2.7.5) [gem]" level="application" />
94
- <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.5.4, RVM: ruby-2.7.5) [gem]" level="application" />
94
+ <orderEntry type="library" scope="PROVIDED" name="yard (v0.9.28, RVM: ruby-2.7.5) [gem]" level="application" />
95
+ <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.6.6, RVM: ruby-2.7.5) [gem]" level="application" />
95
96
  </component>
96
97
  <component name="RModuleSettingsStorage">
97
98
  <LOAD_PATH number="2" string0="$MODULE_DIR$/lib" string1="$MODULE_DIR$/spec" />
@@ -108,12 +109,14 @@
108
109
  </RakeTaskImpl>
109
110
  <RakeTaskImpl description="Run all specs in spec directory, with coverage" fullCommand="coverage" id="coverage" />
110
111
  <RakeTaskImpl description="Run tests, check test coverage, check code style, check for vulnerabilities, build gem" fullCommand="default" id="default" />
111
- <RakeTaskImpl description="Build berkeley_library-alma.gemspec as berkeley_library-alma-0.0.5.gem" fullCommand="gem" id="gem" />
112
+ <RakeTaskImpl description="Build berkeley_library-alma.gemspec as berkeley_library-alma-0.0.7.1.gem" fullCommand="gem" id="gem" />
112
113
  <RakeTaskImpl description="Run RuboCop with auto-correct, and output results to console" fullCommand="ra" id="ra" />
113
114
  <RakeTaskImpl description="Run rubocop with HTML output" fullCommand="rubocop" id="rubocop" />
114
115
  <RakeTaskImpl id="rubocop">
115
116
  <subtasks>
116
- <RakeTaskImpl description="Auto-correct RuboCop offenses" fullCommand="rubocop:auto_correct" id="auto_correct" />
117
+ <RakeTaskImpl description="Autocorrect RuboCop offenses (only when it's safe)" fullCommand="rubocop:autocorrect" id="autocorrect" />
118
+ <RakeTaskImpl description="Autocorrect RuboCop offenses (safe and unsafe)" fullCommand="rubocop:autocorrect_all" id="autocorrect_all" />
119
+ <RakeTaskImpl description="" fullCommand="rubocop:auto_correct" id="auto_correct" />
117
120
  </subtasks>
118
121
  </RakeTaskImpl>
119
122
  <RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
data/.rubocop.yml CHANGED
@@ -328,7 +328,300 @@ Style/SwapValues: # (new in 1.1)
328
328
  ############################################################
329
329
  # Added in RuboCop 1.10
330
330
 
331
- Gemspec/DateAssignment: # (new in 1.10)
332
- Enabled: true
333
331
  Style/HashConversion: # (new in 1.10)
334
332
  Enabled: true
333
+
334
+ ############################################################
335
+ # Added in RuboCop 1.12
336
+
337
+ Style/StringChars: # (new in 1.12)
338
+ Enabled: true
339
+
340
+ ############################################################
341
+ # Added in RuboCop 1.16
342
+
343
+ Lint/EmptyInPattern: # (new in 1.16)
344
+ Enabled: true
345
+ Style/InPatternThen: # (new in 1.16)
346
+ Enabled: true
347
+ Style/MultilineInPatternThen: # (new in 1.16)
348
+ Enabled: true
349
+ Style/QuotedSymbols: # (new in 1.16)
350
+ Enabled: true
351
+
352
+ ############################################################
353
+ # Added in RuboCop 1.18
354
+
355
+ Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
356
+ Enabled: true
357
+
358
+ ############################################################
359
+ # Added in RuboCop 1.19
360
+
361
+ Lint/AmbiguousRange: # (new in 1.19)
362
+ Enabled: true
363
+ Style/RedundantSelfAssignmentBranch: # (new in 1.19)
364
+ Enabled: true
365
+
366
+ ############################################################
367
+ # Added in RuboCop 1.21
368
+
369
+ Lint/AmbiguousOperatorPrecedence: # (new in 1.21)
370
+ Enabled: true
371
+ Lint/IncompatibleIoSelectWithFiberScheduler: # (new in 1.21)
372
+ Enabled: true
373
+
374
+ ############################################################
375
+ # Added in RuboCop 1.22
376
+
377
+ Lint/RequireRelativeSelfPath: # (new in 1.22)
378
+ Enabled: true
379
+ Security/IoMethods: # (new in 1.22)
380
+ Enabled: true
381
+ Style/NumberedParameters: # (new in 1.22)
382
+ Enabled: true
383
+ Style/NumberedParametersLimit: # (new in 1.22)
384
+ Enabled: true
385
+ Style/SelectByRegexp: # (new in 1.22)
386
+ Enabled: true
387
+
388
+ ############################################################
389
+ # Added in RuboCop 1.23
390
+
391
+ Gemspec/RequireMFA: # (new in 1.23)
392
+ Enabled: true
393
+ Lint/UselessRuby2Keywords: # (new in 1.23)
394
+ Enabled: true
395
+ Style/OpenStructUse: # (new in 1.23)
396
+ Enabled: true
397
+
398
+ ############################################################
399
+ # Added in RuboCop 1.24
400
+
401
+ Naming/BlockForwarding: # (new in 1.24)
402
+ Enabled: true
403
+ Style/FileRead: # (new in 1.24)
404
+ Enabled: true
405
+ Style/FileWrite: # (new in 1.24)
406
+ Enabled: true
407
+ Style/MapToHash: # (new in 1.24)
408
+ Enabled: true
409
+
410
+ ############################################################
411
+ # Added in RuboCop 1.26
412
+
413
+ Style/NestedFileDirname: # (new in 1.26)
414
+ Enabled: true
415
+
416
+ ############################################################
417
+ # Added in RuboCop 1.27
418
+
419
+ Lint/RefinementImportMethods: # (new in 1.27)
420
+ Enabled: true
421
+ Style/RedundantInitialize: # (new in 1.27)
422
+ Enabled: true
423
+
424
+ ############################################################
425
+ # Added in RuboCop 1.28
426
+
427
+ Security/CompoundHash: # (new in 1.28)
428
+ Enabled: true
429
+ Style/FetchEnvVar: # (new in 1.28)
430
+ Enabled: true
431
+ Style/ObjectThen: # (new in 1.28)
432
+ Enabled: true
433
+
434
+ ############################################################
435
+ # Added in RuboCop 1.29
436
+
437
+ Style/EnvHome: # (new in 1.29)
438
+ Enabled: true
439
+
440
+ ############################################################
441
+ # Added in RuboCop 1.30
442
+
443
+ Gemspec/DeprecatedAttributeAssignment: # (new in 1.30)
444
+ Enabled: true
445
+ Style/MapCompactWithConditionalBlock: # (new in 1.30)
446
+ Enabled: true
447
+
448
+ ############################################################
449
+ # Added in RuboCop 1.31
450
+
451
+ Layout/LineContinuationLeadingSpace: # (new in 1.31)
452
+ Enabled: true
453
+ Layout/LineContinuationSpacing: # (new in 1.31)
454
+ Enabled: true
455
+ Lint/ConstantOverwrittenInRescue: # (new in 1.31)
456
+ Enabled: true
457
+ Lint/NonAtomicFileOperation: # (new in 1.31)
458
+ Enabled: true
459
+
460
+ ############################################################
461
+ # Added in RuboCop 1.32
462
+
463
+ Lint/RequireRangeParentheses: # (new in 1.32)
464
+ Enabled: true
465
+ Style/EmptyHeredoc: # (new in 1.32)
466
+ Enabled: true
467
+
468
+ ############################################################
469
+ # Added in RuboCop 1.35
470
+
471
+ Style/MagicCommentFormat: # (new in 1.35)
472
+ Enabled: true
473
+
474
+ ############################################################
475
+ # Added in RuboCop 1.37
476
+
477
+ Lint/DuplicateMagicComment: # (new in 1.37)
478
+ Enabled: true
479
+ Style/OperatorMethodCall: # (new in 1.37)
480
+ Enabled: true
481
+ Style/RedundantStringEscape: # (new in 1.37)
482
+ Enabled: true
483
+
484
+ ############################################################
485
+ # Added in RuboCop 1.38
486
+
487
+ Style/RedundantEach: # (new in 1.38)
488
+ Enabled: true
489
+
490
+ Gemspec/AddRuntimeDependency: # new in 1.65
491
+ Enabled: true
492
+ Gemspec/AttributeAssignment: # new in 1.77
493
+ Enabled: true
494
+ Gemspec/DevelopmentDependencies: # new in 1.44
495
+ Enabled: false
496
+ Lint/ArrayLiteralInRegexp: # new i n 1.71
497
+ Enabled: true
498
+ Lint/ConstantReassignment: # new in 1.70
499
+ Enabled: true
500
+ Lint/CopDirectiveSyntax: # new in 1.72
501
+ Enabled: true
502
+ Lint/DuplicateMatchPattern: # new in 1.50
503
+ Enabled: true
504
+ Lint/DuplicateSetElement: # new in 1.67
505
+ Enabled: true
506
+ Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
507
+ Enabled: true
508
+ Lint/ItWithoutArgumentsInBlock: # new in 1.59
509
+ Enabled: true
510
+ Lint/LiteralAssignmentInCondition: # new in 1.58
511
+ Enabled: true
512
+ Lint/MixedCaseRange: # new in 1.53
513
+ Enabled: true
514
+ Lint/NumericOperationWithConstantResult: # new in 1.69
515
+ Enabled: true
516
+ Lint/RedundantRegexpQuantifiers: # new in 1.53
517
+ Enabled: true
518
+ Lint/RedundantTypeConversion: # new in 1.72
519
+ Enabled: true
520
+ Lint/SharedMutableDefault: # new in 1.70
521
+ Enabled: true
522
+ Lint/SuppressedExceptionInNumberConversion: # new in 1.72
523
+ Enabled: true
524
+ Lint/UnescapedBracketInRegexp: # new in 1.68
525
+ Enabled: true
526
+ Lint/UselessConstantScoping: # new in 1.72
527
+ Enabled: true
528
+ Lint/UselessDefaultValueArgument: # new in 1.76
529
+ Enabled: true
530
+ Lint/UselessDefined: # new in 1.69
531
+ Enabled: true
532
+ Lint/UselessNumericOperation: # new in 1.66
533
+ Enabled: true
534
+ Lint/UselessOr: # new in 1.76
535
+ Enabled: true
536
+ Lint/UselessRescue: # new in 1.43
537
+ Enabled: true
538
+ Metrics/CollectionLiteralLength: # new in 1.47
539
+ Enabled: true
540
+ Naming/PredicateMethod: # new in 1.76
541
+ Enabled: true
542
+ Style/AmbiguousEndlessMethodDefinition: # new in 1.68
543
+ Enabled: true
544
+ Style/ArrayIntersect: # new in 1.40
545
+ Enabled: true
546
+ Style/BitwisePredicate: # new in 1.68
547
+ Enabled: true
548
+ Style/CollectionQuerying: # new in 1.77
549
+ Enabled: true
550
+ Style/CombinableDefined: # new in 1.68
551
+ Enabled: true
552
+ Style/ComparableBetween: # new in 1.74
553
+ Enabled: true
554
+ Style/ComparableClamp: # new in 1.44
555
+ Enabled: true
556
+ Style/ConcatArrayLiterals: # new in 1.41
557
+ Enabled: true
558
+ Style/DataInheritance: # new in 1.49
559
+ Enabled: true
560
+ Style/DigChain: # new in 1.69
561
+ Enabled: true
562
+ Style/DirEmpty: # new in 1.48
563
+ Enabled: true
564
+ Style/EmptyStringInsideInterpolation: # new in 1.76
565
+ Enabled: true
566
+ Style/ExactRegexpMatch: # new in 1.51
567
+ Enabled: true
568
+ Style/FileEmpty: # new in 1.48
569
+ Enabled: true
570
+ Style/FileNull: # new in 1.69
571
+ Enabled: true
572
+ Style/FileTouch: # new in 1.69
573
+ Enabled: true
574
+ Style/HashFetchChain: # new in 1.75
575
+ Enabled: true
576
+ Style/HashSlice: # new in 1.71
577
+ Enabled: true
578
+ Style/ItAssignment: # new in 1.70
579
+ Enabled: true
580
+ Style/ItBlockParameter: # new in 1.75
581
+ Enabled: true
582
+ Style/KeywordArgumentsMerging: # new in 1.68
583
+ Enabled: true
584
+ Style/MapIntoArray: # new in 1.63
585
+ Enabled: true
586
+ Style/MapToSet: # new in 1.42
587
+ Enabled: true
588
+ Style/MinMaxComparison: # new in 1.42
589
+ Enabled: true
590
+ Style/RedundantArrayConstructor: # new in 1.52
591
+ Enabled: true
592
+ Style/RedundantArrayFlatten: # new in 1.76
593
+ Enabled: true
594
+ Style/RedundantConstantBase: # new in 1.40
595
+ Enabled: true
596
+ Style/RedundantCurrentDirectoryInPath: # new in 1.53
597
+ Enabled: true
598
+ Style/RedundantDoubleSplatHashBraces: # new in 1.41
599
+ Enabled: true
600
+ Style/RedundantFilterChain: # new in 1.52
601
+ Enabled: true
602
+ Style/RedundantFormat: # new in 1.72
603
+ Enabled: true
604
+ Style/RedundantHeredocDelimiterQuotes: # new in 1.45
605
+ Enabled: true
606
+ Style/RedundantInterpolationUnfreeze: # new in 1.66
607
+ Enabled: true
608
+ Style/RedundantLineContinuation: # new in 1.49
609
+ Enabled: true
610
+ Style/RedundantRegexpArgument: # new in 1.53
611
+ Enabled: true
612
+ Style/RedundantRegexpConstructor: # new in 1.52
613
+ Enabled: true
614
+ Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
615
+ Enabled: true
616
+ Style/SafeNavigationChainLength: # new in 1.68
617
+ Enabled: true
618
+ Style/SendWithLiteralMethodName: # new in 1.64
619
+ Enabled: true
620
+ Style/SingleLineDoEndBlock: # new in 1.57
621
+ Enabled: true
622
+ Style/SuperArguments: # new in 1.64
623
+ Enabled: true
624
+ Style/SuperWithArgsParentheses: # new in 1.58
625
+ Enabled: true
626
+ Style/YAMLFileRead: # new in 1.53
627
+ Enabled: true
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.1.1 (23 July 2025)
2
+
3
+ - Update to support Ruby 3.3+.
4
+ - Update Rubocop & style changes.
5
+ - Add `alma-oclc-lookup` script.
6
+
1
7
  # 0.0.7.1 (24 May 2022)
2
8
 
3
9
  - Set minimum Nokogiri version to address
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  # =============================================================================
2
2
  # Target: base
3
3
 
4
- FROM ruby:2.7.5-alpine AS base
4
+ FROM ruby:3.3-alpine AS base
5
5
 
6
6
  RUN apk --no-cache --update upgrade && \
7
7
  apk --no-cache add \
@@ -12,6 +12,7 @@ RUN apk --no-cache --update upgrade && \
12
12
  openssl \
13
13
  tzdata \
14
14
  xz-libs \
15
+ yaml-dev \
15
16
  && rm -rf /var/cache/apk/*
16
17
 
17
18
  WORKDIR /opt/app
@@ -51,4 +52,4 @@ COPY --from=development /usr/local/bundle /usr/local/bundle
51
52
  RUN bundle config set deployment 'true'
52
53
  RUN bundle install --local --path=/usr/local/bundle
53
54
 
54
- CMD ['bundle', 'exec', 'rake']
55
+ CMD ["bundle", "exec", "rake"]
data/README.md CHANGED
@@ -263,3 +263,26 @@ b1234
263
263
  9912348245906531 9912348245906531
264
264
  b110824349 b110824349 991038544199706532
265
265
  ```
266
+
267
+
268
+ ### `alma-oclc-lookup`: 035$a OCLC number lookup
269
+
270
+ The `alma-oclc-lookup` script takes one ore more record IDs (either Millennium bib
271
+ numbers or Alma MMS IDs) and attempts to read the corresponding MARC records via
272
+ [SRU](https://developers.exlibrisgroup.com/alma/integrations/sru/) and extract
273
+ the OCLC number(s) from the 035$a field.
274
+
275
+ #### Output format
276
+
277
+ The output is tab-separated, in the form
278
+
279
+ ```none
280
+ <record ID> <OCLC number(s)…>
281
+ ```
282
+
283
+ E.g.
284
+
285
+ ```none
286
+ $ echo '991051353589706532' | bin/alma-oclc-lookup ✹ ✚main ‹ruby-2.7.5›
287
+ 991051353589706532 1097551039
288
+ ```
@@ -8,8 +8,8 @@ require 'berkeley_library/alma/module_info'
8
8
 
9
9
  Gem::Specification.new do |spec|
10
10
  spec.name = BerkeleyLibrary::Alma::ModuleInfo::NAME
11
- spec.author = BerkeleyLibrary::Alma::ModuleInfo::AUTHOR
12
- spec.email = BerkeleyLibrary::Alma::ModuleInfo::AUTHOR_EMAIL
11
+ spec.author = BerkeleyLibrary::Alma::ModuleInfo::AUTHORS
12
+ spec.email = BerkeleyLibrary::Alma::ModuleInfo::AUTHOR_EMAILS
13
13
  spec.summary = BerkeleyLibrary::Alma::ModuleInfo::SUMMARY
14
14
  spec.description = BerkeleyLibrary::Alma::ModuleInfo::DESCRIPTION
15
15
  spec.license = BerkeleyLibrary::Alma::ModuleInfo::LICENSE
@@ -17,7 +17,6 @@ Gem::Specification.new do |spec|
17
17
  spec.homepage = BerkeleyLibrary::Alma::ModuleInfo::HOMEPAGE
18
18
 
19
19
  spec.files = `git ls-files -z`.split("\x0")
20
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
20
  spec.require_paths = ['lib']
22
21
 
23
22
  spec.required_ruby_version = ruby_version
@@ -32,11 +31,12 @@ Gem::Specification.new do |spec|
32
31
  spec.add_development_dependency 'colorize', '~> 0.8'
33
32
  spec.add_development_dependency 'rake', '~> 13.0'
34
33
  spec.add_development_dependency 'rspec', '~> 3.10'
35
- spec.add_development_dependency 'rubocop', '= 1.11'
36
- spec.add_development_dependency 'rubocop-rake', '= 0.6.0'
37
- spec.add_development_dependency 'rubocop-rspec', '= 2.4.0'
34
+ spec.add_development_dependency 'rubocop', '~> 1.78.0'
35
+ spec.add_development_dependency 'rubocop-rake', '~> 0.7.0'
36
+ spec.add_development_dependency 'rubocop-rspec', '~> 3.6.0'
38
37
  spec.add_development_dependency 'simplecov', '~> 0.21'
39
38
  spec.add_development_dependency 'simplecov-rcov', '~> 0.2'
40
39
  spec.add_development_dependency 'webmock', '~> 3.12'
41
40
  spec.add_development_dependency 'yard', '~> 0.9.27'
41
+ spec.metadata['rubygems_mfa_required'] = 'true'
42
42
  end
data/bin/alma-mms-lookup CHANGED
@@ -14,7 +14,7 @@ $stderr.sync = true
14
14
  require 'bundler/setup'
15
15
 
16
16
  # Require lib directory
17
- unless $LOAD_PATH.include?((lib_path = File.expand_path('../lib', __dir__)))
17
+ unless $LOAD_PATH.include?(lib_path = File.expand_path('../lib', __dir__))
18
18
  puts "Adding #{lib_path} to $LOAD_PATH"
19
19
  $LOAD_PATH.unshift(lib_path)
20
20
  end
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # ------------------------------------------------------------
4
+ # Global setup
5
+
6
+ # Don't buffer stdout or stderr
7
+ $stdout.sync = true
8
+ $stderr.sync = true
9
+
10
+ # ------------------------------------------------------------
11
+ # Dependencies
12
+
13
+ # Require gems
14
+ require 'bundler/setup'
15
+
16
+ # Require lib directory
17
+ unless $LOAD_PATH.include?(lib_path = File.expand_path('../lib', __dir__))
18
+ puts "Adding #{lib_path} to $LOAD_PATH"
19
+ $LOAD_PATH.unshift(lib_path)
20
+ end
21
+
22
+ require 'berkeley_library/alma'
23
+ require 'marc/spec'
24
+
25
+ # ------------------------------------------------------------
26
+ # Configuration
27
+
28
+ # Configure Alma URLs etc.
29
+ BerkeleyLibrary::Alma::Config.default!
30
+
31
+ # Configure logging
32
+ logger = BerkeleyLibrary::Logging::Loggers.new_readable_logger($stderr)
33
+ logger.level = Logger::Severity::WARN
34
+ BerkeleyLibrary::Logging.logger = logger
35
+
36
+ # ------------------------------------------------------------
37
+ # Constants
38
+
39
+ OCLC_NUM_RE = /(?<=\(OCoLC\))(?<num>\d+)/.freeze
40
+
41
+ # ------------------------------------------------------------
42
+ # Utility methods
43
+
44
+ # Read raw IDs from STDIN
45
+ def raw_ids
46
+ @raw_ids ||= Enumerator.new do |y|
47
+ $stdin.each_line(chomp: true) do |ln|
48
+ y << ln.strip
49
+ end
50
+ end
51
+ end
52
+
53
+ def ids_035a_for(record_id)
54
+ return unless record_id
55
+ return unless (marc_record = record_id.get_marc_record)
56
+
57
+ MARC::Spec.find('035$a', marc_record)
58
+ end
59
+
60
+ def oclc_nums_for(record_id)
61
+ return [] unless (ids_035a = ids_035a_for(record_id))
62
+
63
+ ids_035a.filter_map do |sf_035a|
64
+ next unless (val = sf_035a.value)
65
+ next unless (md = OCLC_NUM_RE.match(val))
66
+
67
+ md[:num]
68
+ end
69
+ end
70
+
71
+ # ------------------------------------------------------------
72
+ # Main program
73
+
74
+ raw_ids.each do |raw_id|
75
+ record_id = BerkeleyLibrary::Alma::RecordId.parse(raw_id)
76
+ oclc_nums = oclc_nums_for(record_id)
77
+ puts [raw_id, *oclc_nums].join("\t")
78
+ end
@@ -2,12 +2,12 @@ module BerkeleyLibrary
2
2
  module Alma
3
3
  class ModuleInfo
4
4
  NAME = 'berkeley_library-alma'.freeze
5
- AUTHOR = 'David Moles'.freeze
6
- AUTHOR_EMAIL = 'dmoles@berkeley.edu'.freeze
5
+ AUTHORS = ['David Moles', 'maría a. matienzo'].freeze
6
+ AUTHOR_EMAILS = ['dmoles@berkeley.edu', 'matienzo@berkeley.edu'].freeze
7
7
  SUMMARY = 'Alma/Primo utilities for the UC Berkeley Library'.freeze
8
8
  DESCRIPTION = 'A gem providing Alma/Primo-related utility code for the UC Berkeley Library'.freeze
9
9
  LICENSE = 'MIT'.freeze
10
- VERSION = '0.0.7.1'.freeze
10
+ VERSION = '0.1.1'.freeze
11
11
  HOMEPAGE = 'https://github.com/BerkeleyLibrary/alma'.freeze
12
12
  end
13
13
  end
@@ -36,7 +36,8 @@ module BerkeleyLibrary
36
36
  return id if id.is_a?(RecordId)
37
37
 
38
38
  return MMSID.new(id) if ALMA_RECORD_RE =~ id
39
- return BibNumber.new(id) if MILLENNIUM_RECORD_RE =~ id
39
+
40
+ BibNumber.new(id) if MILLENNIUM_RECORD_RE =~ id
40
41
  end
41
42
  end
42
43
 
@@ -110,7 +110,7 @@ module BerkeleyLibrary
110
110
  # @see Nokogiri::XML::Sax::Document#characters
111
111
  # rubocop:disable Metrics/MethodLength
112
112
  def characters(string)
113
- return super unless NS_SRW == @current_element_ns
113
+ return super unless @current_element_ns == NS_SRW
114
114
  return unless (name = @current_element_name)
115
115
 
116
116
  case name
@@ -0,0 +1,4 @@
1
+ inherit_from: ../.rubocop.yml
2
+
3
+ plugins:
4
+ - rubocop-rake
data/spec/.rubocop.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  inherit_from: ../.rubocop.yml
2
2
 
3
+ plugins:
4
+ - rubocop-rspec
5
+
3
6
  AllCops:
4
7
  # Exclude generated files
5
8
  Exclude:
@@ -35,3 +38,93 @@ Metrics/MethodLength:
35
38
  # Sometimes we're testing the operator
36
39
  Lint/BinaryOperatorWithIdenticalOperands:
37
40
  Enabled: false
41
+
42
+ ############################################################
43
+ # rubocop-rspec
44
+
45
+ # believe me, it wasn't by choice
46
+ RSpec/AnyInstance:
47
+ Enabled: false
48
+
49
+ # we meant to do that
50
+ RSpec/BeforeAfterAll:
51
+ Enabled: false
52
+
53
+ # more words != more readable
54
+ RSpec/ContextWording:
55
+ Enabled: false
56
+
57
+ # explicit >>> implicit
58
+ RSpec/DescribedClass:
59
+ Enabled: false
60
+
61
+ # more punctuation != more readable
62
+ RSpec/DescribeSymbol:
63
+ Enabled: false
64
+
65
+ # setup cost / time >>> failure granularity
66
+ RSpec/ExampleLength:
67
+ Max: 15
68
+ CountAsOne:
69
+ - array
70
+ - hash
71
+ - heredoc
72
+
73
+ # we meant to do that
74
+ RSpec/ExpectInHook:
75
+ Enabled: false
76
+
77
+ RSpec/IndexedLet:
78
+ Enabled: false
79
+
80
+ # your naming scheme is not in possession of all the facts
81
+ RSpec/SpecFilePathFormat:
82
+ Enabled: false
83
+
84
+ RSpec/SpecFilePathSuffix:
85
+ Enabled: true
86
+
87
+ # explicit >>> implicit
88
+ RSpec/InstanceVariable:
89
+ Enabled: false
90
+
91
+ # maybe when 'all' has a corresponding 'none' matcher
92
+ RSpec/IteratedExpectation:
93
+ Enabled: false
94
+
95
+ # we meant to do that
96
+ RSpec/MessageSpies:
97
+ Enabled: false
98
+
99
+ # too late now
100
+ RSpec/MultipleMemoizedHelpers:
101
+ Enabled: false
102
+
103
+ # setup cost / time >>> failure granularity
104
+ RSpec/MultipleExpectations:
105
+ Enabled: false
106
+
107
+ # cure is worse than the disease
108
+ RSpec/NestedGroups:
109
+ Enabled: false
110
+
111
+ # more quotation marks != more readable
112
+ RSpec/SharedExamples:
113
+ Enabled: false
114
+
115
+ # we meant to do that
116
+ RSpec/StubbedMock:
117
+ Enabled: false
118
+
119
+ # we meant to do that
120
+ RSpec/VerifiedDoubles:
121
+ Enabled: false
122
+
123
+ ############################################################
124
+ # rubocop-rspec
125
+
126
+ # enable newer rubocop-rspec cops
127
+
128
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
129
+ Enabled: true
130
+
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module BerkeleyLibrary
4
4
  module Alma
5
5
  describe BarCode do
6
- before(:each) do
6
+ before do
7
7
  BerkeleyLibrary::Alma.configure do
8
8
  Config.alma_sru_host = 'berkeley.alma.exlibrisgroup.com'
9
9
  Config.alma_institution_code = '01UCS_BER'
@@ -12,7 +12,7 @@ module BerkeleyLibrary
12
12
  end
13
13
  end
14
14
 
15
- after(:each) do
15
+ after do
16
16
  BerkeleyLibrary::Alma::Config.send(:clear!)
17
17
  end
18
18
 
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module BerkeleyLibrary
4
4
  module Alma
5
5
  describe BibNumber do
6
- before(:each) do
6
+ before do
7
7
  BerkeleyLibrary::Alma.configure do
8
8
  Config.alma_sru_host = 'berkeley.alma.exlibrisgroup.com'
9
9
  Config.alma_institution_code = '01UCS_BER'
@@ -12,7 +12,7 @@ module BerkeleyLibrary
12
12
  end
13
13
  end
14
14
 
15
- after(:each) do
15
+ after do
16
16
  BerkeleyLibrary::Alma::Config.send(:clear!)
17
17
  end
18
18
 
@@ -6,7 +6,7 @@ module BerkeleyLibrary
6
6
  module Alma
7
7
  describe Config do
8
8
 
9
- after(:each) do
9
+ after do
10
10
  Config.send(:clear!)
11
11
  end
12
12
 
@@ -52,8 +52,10 @@ module BerkeleyLibrary
52
52
  describe 'with Rails config' do
53
53
  attr_reader :rails_config
54
54
 
55
- before(:each) do
56
- @rails_config = OpenStruct.new
55
+ before do
56
+ @rails_config = Class.new do
57
+ attr_accessor :alma_sru_host, :alma_institution_code
58
+ end.new
57
59
 
58
60
  application = double(Object)
59
61
  allow(application).to receive(:config).and_return(rails_config)
@@ -64,8 +66,8 @@ module BerkeleyLibrary
64
66
  Object.const_set(:Rails, rails)
65
67
  end
66
68
 
67
- after(:each) do
68
- Object.send(:remove_const, :Rails)
69
+ after do
70
+ Object.send(:remove_const, :Rails) # rubocop:disable RSpec/RemoveConst
69
71
  end
70
72
 
71
73
  describe :alma_sru_base_uri do
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module BerkeleyLibrary
4
4
  module Alma
5
5
  describe MMSID do
6
- before(:each) do
6
+ before do
7
7
  BerkeleyLibrary::Alma.configure do
8
8
  Config.alma_sru_host = 'berkeley.alma.exlibrisgroup.com'
9
9
  Config.alma_institution_code = '01UCS_BER'
@@ -12,7 +12,7 @@ module BerkeleyLibrary
12
12
  end
13
13
  end
14
14
 
15
- after(:each) do
15
+ after do
16
16
  BerkeleyLibrary::Alma::Config.send(:clear!)
17
17
  end
18
18
 
@@ -39,6 +39,7 @@ module BerkeleyLibrary
39
39
 
40
40
  describe 'SRU methods' do
41
41
  before { Config.default! }
42
+
42
43
  after { Config.send(:clear!) }
43
44
 
44
45
  describe :get_marc_xml do
@@ -4,6 +4,7 @@ module BerkeleyLibrary
4
4
  module Alma
5
5
  describe SRU do
6
6
  before { Config.default! }
7
+
7
8
  after { Config.send(:clear!) }
8
9
 
9
10
  describe :get_marc_records do
@@ -20,7 +21,7 @@ module BerkeleyLibrary
20
21
  reader = SRU.get_marc_records(*mms_ids)
21
22
  marc_records = reader.to_a
22
23
  expect(marc_records.size).to eq(mms_ids.size)
23
- expect(marc_records.map(&:record_id)).to contain_exactly(*mms_ids)
24
+ expect(marc_records.map(&:record_id)).to match_array(mms_ids)
24
25
  end
25
26
  end
26
27
 
@@ -59,7 +60,7 @@ module BerkeleyLibrary
59
60
  reader = SRU.get_marc_records(*mms_ids)
60
61
  marc_records = reader.to_a
61
62
  expect(marc_records.size).to eq(mms_ids.size)
62
- expect(marc_records.map(&:record_id)).to contain_exactly(*mms_ids)
63
+ expect(marc_records.map(&:record_id)).to match_array(mms_ids)
63
64
  end
64
65
 
65
66
  it 'does not freeze records by default' do
@@ -67,7 +68,7 @@ module BerkeleyLibrary
67
68
 
68
69
  reader = SRU.get_marc_records(*mms_ids)
69
70
  reader.to_a.each do |record|
70
- expect(record.frozen?).to eq(false)
71
+ expect(record.frozen?).to be(false)
71
72
  end
72
73
  end
73
74
 
@@ -76,7 +77,7 @@ module BerkeleyLibrary
76
77
 
77
78
  reader = SRU.get_marc_records(*mms_ids, freeze: true)
78
79
  reader.to_a.each do |record|
79
- expect(record.frozen?).to eq(true)
80
+ expect(record.frozen?).to be(true)
80
81
  end
81
82
  end
82
83
 
@@ -18,7 +18,7 @@ module BerkeleyLibrary
18
18
 
19
19
  describe :new do
20
20
  it 'raises an error for unreadable sources' do
21
- not_xml = Object.new
21
+ not_xml = 'string'
22
22
  expect { XMLReader.read(not_xml) }.to raise_error(ArgumentError)
23
23
  end
24
24
  end
data/spec/spec_helper.rb CHANGED
@@ -15,8 +15,8 @@ RSpec.configure do |config|
15
15
  config.color = true
16
16
  config.tty = true
17
17
  config.formatter = :documentation
18
- config.before(:each) { WebMock.disable_net_connect!(allow_localhost: true) }
19
- config.after(:each) { WebMock.allow_net_connect! }
18
+ config.before { WebMock.disable_net_connect!(allow_localhost: true) }
19
+ config.after { WebMock.allow_net_connect! }
20
20
  config.mock_with :rspec do |mocks|
21
21
  mocks.verify_partial_doubles = true
22
22
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkeley_library-alma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7.1
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Moles
8
+ - maría a. matienzo
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2022-05-24 00:00:00.000000000 Z
12
+ date: 2025-07-23 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: berkeley_library-logging
@@ -152,44 +153,44 @@ dependencies:
152
153
  name: rubocop
153
154
  requirement: !ruby/object:Gem::Requirement
154
155
  requirements:
155
- - - '='
156
+ - - "~>"
156
157
  - !ruby/object:Gem::Version
157
- version: '1.11'
158
+ version: 1.78.0
158
159
  type: :development
159
160
  prerelease: false
160
161
  version_requirements: !ruby/object:Gem::Requirement
161
162
  requirements:
162
- - - '='
163
+ - - "~>"
163
164
  - !ruby/object:Gem::Version
164
- version: '1.11'
165
+ version: 1.78.0
165
166
  - !ruby/object:Gem::Dependency
166
167
  name: rubocop-rake
167
168
  requirement: !ruby/object:Gem::Requirement
168
169
  requirements:
169
- - - '='
170
+ - - "~>"
170
171
  - !ruby/object:Gem::Version
171
- version: 0.6.0
172
+ version: 0.7.0
172
173
  type: :development
173
174
  prerelease: false
174
175
  version_requirements: !ruby/object:Gem::Requirement
175
176
  requirements:
176
- - - '='
177
+ - - "~>"
177
178
  - !ruby/object:Gem::Version
178
- version: 0.6.0
179
+ version: 0.7.0
179
180
  - !ruby/object:Gem::Dependency
180
181
  name: rubocop-rspec
181
182
  requirement: !ruby/object:Gem::Requirement
182
183
  requirements:
183
- - - '='
184
+ - - "~>"
184
185
  - !ruby/object:Gem::Version
185
- version: 2.4.0
186
+ version: 3.6.0
186
187
  type: :development
187
188
  prerelease: false
188
189
  version_requirements: !ruby/object:Gem::Requirement
189
190
  requirements:
190
- - - '='
191
+ - - "~>"
191
192
  - !ruby/object:Gem::Version
192
- version: 2.4.0
193
+ version: 3.6.0
193
194
  - !ruby/object:Gem::Dependency
194
195
  name: simplecov
195
196
  requirement: !ruby/object:Gem::Requirement
@@ -247,12 +248,15 @@ dependencies:
247
248
  - !ruby/object:Gem::Version
248
249
  version: 0.9.27
249
250
  description: A gem providing Alma/Primo-related utility code for the UC Berkeley Library
250
- email: dmoles@berkeley.edu
251
+ email:
252
+ - dmoles@berkeley.edu
253
+ - matienzo@berkeley.edu
251
254
  executables: []
252
255
  extensions: []
253
256
  extra_rdoc_files: []
254
257
  files:
255
258
  - ".github/workflows/build.yml"
259
+ - ".github/workflows/gem-push.yml"
256
260
  - ".gitignore"
257
261
  - ".idea/.gitignore"
258
262
  - ".idea/alma.iml"
@@ -273,6 +277,7 @@ files:
273
277
  - Rakefile
274
278
  - berkeley_library-alma.gemspec
275
279
  - bin/alma-mms-lookup
280
+ - bin/alma-oclc-lookup
276
281
  - docker-compose.yml
277
282
  - lib/berkeley_library/alma.rb
278
283
  - lib/berkeley_library/alma/barcode.rb
@@ -285,6 +290,7 @@ files:
285
290
  - lib/berkeley_library/alma/sru.rb
286
291
  - lib/berkeley_library/alma/sru/sru.rb
287
292
  - lib/berkeley_library/alma/sru/xml_reader.rb
293
+ - rakelib/.rubocop.yml
288
294
  - rakelib/bundle.rake
289
295
  - rakelib/coverage.rake
290
296
  - rakelib/gem.rake
@@ -309,7 +315,8 @@ files:
309
315
  homepage: https://github.com/BerkeleyLibrary/alma
310
316
  licenses:
311
317
  - MIT
312
- metadata: {}
318
+ metadata:
319
+ rubygems_mfa_required: 'true'
313
320
  post_install_message:
314
321
  rdoc_options: []
315
322
  require_paths:
@@ -325,24 +332,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
332
  - !ruby/object:Gem::Version
326
333
  version: '0'
327
334
  requirements: []
328
- rubygems_version: 3.1.6
335
+ rubygems_version: 3.5.22
329
336
  signing_key:
330
337
  specification_version: 4
331
338
  summary: Alma/Primo utilities for the UC Berkeley Library
332
- test_files:
333
- - spec/.rubocop.yml
334
- - spec/data/991054360089706532-sru.xml
335
- - spec/data/C084093187-sru.xml
336
- - spec/data/availability-sru-page-1.xml
337
- - spec/data/availability-sru-page-2.xml
338
- - spec/data/availability-sru.xml
339
- - spec/data/b110824349-sru.xml
340
- - spec/data/bibs_with_check_digits.txt
341
- - spec/lib/berkeley_library/alma/barcode_spec.rb
342
- - spec/lib/berkeley_library/alma/bib_number_spec.rb
343
- - spec/lib/berkeley_library/alma/config_spec.rb
344
- - spec/lib/berkeley_library/alma/mms_id_spec.rb
345
- - spec/lib/berkeley_library/alma/record_id_spec.rb
346
- - spec/lib/berkeley_library/alma/sru/sru_spec.rb
347
- - spec/lib/berkeley_library/alma/sru/xml_reader_spec.rb
348
- - spec/spec_helper.rb
339
+ test_files: []