berkeley_library-alma 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/build.yml +18 -0
  3. data/.gitignore +388 -0
  4. data/.idea/.gitignore +8 -0
  5. data/.idea/alma.iml +55 -0
  6. data/.idea/codeStyles/codeStyleConfig.xml +5 -0
  7. data/.idea/inspectionProfiles/Project_Default.xml +26 -0
  8. data/.idea/misc.xml +4 -0
  9. data/.idea/modules.xml +8 -0
  10. data/.idea/vcs.xml +6 -0
  11. data/.rubocop.yml +334 -0
  12. data/.ruby-version +1 -0
  13. data/.simplecov +8 -0
  14. data/.yardopts +2 -0
  15. data/CHANGES.md +3 -0
  16. data/Dockerfile +54 -0
  17. data/Gemfile +3 -0
  18. data/Jenkinsfile +18 -0
  19. data/LICENSE.md +21 -0
  20. data/README.md +210 -0
  21. data/Rakefile +20 -0
  22. data/berkeley_library-alma.gemspec +42 -0
  23. data/bin/alma-mms-lookup +64 -0
  24. data/docker-compose.yml +15 -0
  25. data/lib/berkeley_library/alma/bib_number.rb +90 -0
  26. data/lib/berkeley_library/alma/config.rb +178 -0
  27. data/lib/berkeley_library/alma/constants.rb +16 -0
  28. data/lib/berkeley_library/alma/mms_id.rb +100 -0
  29. data/lib/berkeley_library/alma/module_info.rb +14 -0
  30. data/lib/berkeley_library/alma/record_id.rb +113 -0
  31. data/lib/berkeley_library/alma.rb +1 -0
  32. data/rakelib/bundle.rake +8 -0
  33. data/rakelib/coverage.rake +11 -0
  34. data/rakelib/gem.rake +54 -0
  35. data/rakelib/rubocop.rake +18 -0
  36. data/rakelib/spec.rake +2 -0
  37. data/spec/.rubocop.yml +37 -0
  38. data/spec/data/991054360089706532-sru.xml +186 -0
  39. data/spec/data/b11082434-sru.xml +165 -0
  40. data/spec/data/bibs_with_check_digits.txt +151 -0
  41. data/spec/lib/berkeley_library/alma/bib_number_spec.rb +95 -0
  42. data/spec/lib/berkeley_library/alma/config_spec.rb +94 -0
  43. data/spec/lib/berkeley_library/alma/mms_id_spec.rb +111 -0
  44. data/spec/lib/berkeley_library/alma/record_id_spec.rb +41 -0
  45. data/spec/spec_helper.rb +56 -0
  46. metadata +325 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 165103d093349a8fdbf1c58f6213082b837d32beb7e0132a4bf01ab170c9b6c8
4
+ data.tar.gz: ee15008595d8a305947318fb3f8aacfb604f221267f9935b86750a9b04bbccc6
5
+ SHA512:
6
+ metadata.gz: 0c85207673e810d5e5065d86cafaabb70222e52e360c6335db5fd60bda2331d110a8235355b72a80602b6f255a03dcf278da22f7eab13d35554c37d677e48e84
7
+ data.tar.gz: f0ad3fe12d1bcf8e86be782e47c7ab06b7a9c0f66a4f7aad2e4d0ae2eb356d21e6074c054e3a675d2c7562e7fba0b94a9b3dc04020243039cbf5df71576f5974
@@ -0,0 +1,18 @@
1
+ name: Build
2
+ on: [ push, pull_request ]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ os: [ ubuntu-latest, macos-latest ]
9
+ ruby: [ '2.7', '3.0' ]
10
+ runs-on: ${{ matrix.os }}
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: ${{ matrix.ruby }}
17
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
18
+ - run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,388 @@
1
+ ############################################################
2
+ # Custom ignores
3
+
4
+ # github-markdown-preview previews
5
+ *.md.html
6
+
7
+ # Additional IDEA/RubyMine ignores
8
+ .idea/.rakeTasks
9
+
10
+ # Don't commit Gemfile.lock for libraries
11
+ Gemfile.lock
12
+
13
+ # build artifacts
14
+ /artifacts/
15
+
16
+ ############################################################
17
+ # Generated ignores
18
+
19
+ #### joe made this: http://goel.io/joe
20
+
21
+ #### ruby ####
22
+ *.gem
23
+ *.rbc
24
+ /.config
25
+ /coverage/
26
+ /InstalledFiles
27
+ /pkg/
28
+ /spec/reports/
29
+ /spec/examples.txt
30
+ /test/tmp/
31
+ /test/version_tmp/
32
+ /tmp/
33
+
34
+ # Used by dotenv library to load environment variables.
35
+ # .env
36
+
37
+ # Ignore Byebug command history file.
38
+ .byebug_history
39
+
40
+ ## Specific to RubyMotion:
41
+ .dat*
42
+ .repl_history
43
+ build/
44
+ *.bridgesupport
45
+ build-iPhoneOS/
46
+ build-iPhoneSimulator/
47
+
48
+ ## Specific to RubyMotion (use of CocoaPods):
49
+ #
50
+ # We recommend against adding the Pods directory to your .gitignore. However
51
+ # you should judge for yourself, the pros and cons are mentioned at:
52
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
53
+ #
54
+ # vendor/Pods/
55
+
56
+ ## Documentation cache and generated files:
57
+ /.yardoc/
58
+ /_yardoc/
59
+ /doc/
60
+ /rdoc/
61
+
62
+ ## Environment normalization:
63
+ /.bundle/
64
+ /vendor/bundle
65
+ /lib/bundler/man/
66
+
67
+ # for a library or gem, you might want to ignore these files since the code is
68
+ # intended to run in multiple environments; otherwise, check them in:
69
+ # Gemfile.lock
70
+ # .ruby-version
71
+ # .ruby-gemset
72
+
73
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
74
+ .rvmrc
75
+
76
+
77
+ #### rails ####
78
+ *.rbc
79
+ capybara-*.html
80
+ .rspec
81
+ /db/*.sqlite3
82
+ /db/*.sqlite3-journal
83
+ /db/*.sqlite3-[0-9]*
84
+ /public/system
85
+ /coverage/
86
+ /spec/tmp
87
+ *.orig
88
+ rerun.txt
89
+ pickle-email-*.html
90
+
91
+ # Ignore all logfiles and tempfiles.
92
+ /log/*
93
+ /tmp/*
94
+ !/log/.keep
95
+ !/tmp/.keep
96
+
97
+ # Comment out this rule if you are OK with secrets being uploaded to the repo
98
+ config/initializers/secret_token.rb
99
+ config/master.key
100
+
101
+ # Only include if you have production secrets in this file, which is no longer a Rails default
102
+ # config/secrets.yml
103
+
104
+ # dotenv
105
+ # Comment out this rule if environment variables can be committed
106
+ .env
107
+
108
+ ## Environment normalization:
109
+ /.bundle
110
+ /vendor/bundle
111
+
112
+ # these should all be checked in to normalize the environment:
113
+ # Gemfile.lock, .ruby-version, .ruby-gemset
114
+
115
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
116
+ .rvmrc
117
+
118
+ # if using bower-rails ignore default bower_components path bower.json files
119
+ /vendor/assets/bower_components
120
+ *.bowerrc
121
+ bower.json
122
+
123
+ # Ignore pow environment settings
124
+ .powenv
125
+
126
+ # Ignore Byebug command history file.
127
+ .byebug_history
128
+
129
+ # Ignore node_modules
130
+ node_modules/
131
+
132
+ # Ignore precompiled javascript packs
133
+ /public/packs
134
+ /public/packs-test
135
+ /public/assets
136
+
137
+ # Ignore yarn files
138
+ /yarn-error.log
139
+ yarn-debug.log*
140
+ .yarn-integrity
141
+
142
+ # Ignore uploaded files in development
143
+ /storage/*
144
+ !/storage/.keep
145
+
146
+
147
+ #### node ####
148
+ # Logs
149
+ logs
150
+ *.log
151
+ npm-debug.log*
152
+ yarn-debug.log*
153
+ yarn-error.log*
154
+ lerna-debug.log*
155
+
156
+ # Diagnostic reports (https://nodejs.org/api/report.html)
157
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
158
+
159
+ # Runtime data
160
+ pids
161
+ *.pid
162
+ *.seed
163
+ *.pid.lock
164
+
165
+ # Directory for instrumented libs generated by jscoverage/JSCover
166
+ lib-cov
167
+
168
+ # Coverage directory used by tools like istanbul
169
+ coverage
170
+ *.lcov
171
+
172
+ # nyc test coverage
173
+ .nyc_output
174
+
175
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
176
+ .grunt
177
+
178
+ # Bower dependency directory (https://bower.io/)
179
+ bower_components
180
+
181
+ # node-waf configuration
182
+ .lock-wscript
183
+
184
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
185
+ build/Release
186
+
187
+ # Dependency directories
188
+ node_modules/
189
+ jspm_packages/
190
+
191
+ # TypeScript v1 declaration files
192
+ typings/
193
+
194
+ # TypeScript cache
195
+ *.tsbuildinfo
196
+
197
+ # Optional npm cache directory
198
+ .npm
199
+
200
+ # Optional eslint cache
201
+ .eslintcache
202
+
203
+ # Optional REPL history
204
+ .node_repl_history
205
+
206
+ # Output of 'npm pack'
207
+ *.tgz
208
+
209
+ # Yarn Integrity file
210
+ .yarn-integrity
211
+
212
+ # dotenv environment variables file
213
+ .env
214
+ .env.test
215
+
216
+ # parcel-bundler cache (https://parceljs.org/)
217
+ .cache
218
+
219
+ # next.js build output
220
+ .next
221
+
222
+ # nuxt.js build output
223
+ .nuxt
224
+
225
+ # vuepress build output
226
+ .vuepress/dist
227
+
228
+ # Serverless directories
229
+ .serverless/
230
+
231
+ # FuseBox cache
232
+ .fusebox/
233
+
234
+ # DynamoDB Local files
235
+ .dynamodb/
236
+
237
+
238
+ #### jetbrains ####
239
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
240
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
241
+
242
+ # User-specific stuff
243
+ .idea/**/workspace.xml
244
+ .idea/**/tasks.xml
245
+ .idea/**/usage.statistics.xml
246
+ .idea/**/dictionaries
247
+ .idea/**/shelf
248
+
249
+ # Generated files
250
+ .idea/**/contentModel.xml
251
+
252
+ # Sensitive or high-churn files
253
+ .idea/**/dataSources/
254
+ .idea/**/dataSources.ids
255
+ .idea/**/dataSources.local.xml
256
+ .idea/**/sqlDataSources.xml
257
+ .idea/**/dynamic.xml
258
+ .idea/**/uiDesigner.xml
259
+ .idea/**/dbnavigator.xml
260
+
261
+ # Gradle
262
+ .idea/**/gradle.xml
263
+ .idea/**/libraries
264
+
265
+ # Gradle and Maven with auto-import
266
+ # When using Gradle or Maven with auto-import, you should exclude module files,
267
+ # since they will be recreated, and may cause churn. Uncomment if using
268
+ # auto-import.
269
+ # .idea/modules.xml
270
+ # .idea/*.iml
271
+ # .idea/modules
272
+ # *.iml
273
+ # *.ipr
274
+
275
+ # CMake
276
+ cmake-build-*/
277
+
278
+ # Mongo Explorer plugin
279
+ .idea/**/mongoSettings.xml
280
+
281
+ # File-based project format
282
+ *.iws
283
+
284
+ # IntelliJ
285
+ out/
286
+
287
+ # mpeltonen/sbt-idea plugin
288
+ .idea_modules/
289
+
290
+ # JIRA plugin
291
+ atlassian-ide-plugin.xml
292
+
293
+ # Cursive Clojure plugin
294
+ .idea/replstate.xml
295
+
296
+ # Crashlytics plugin (for Android Studio and IntelliJ)
297
+ com_crashlytics_export_strings.xml
298
+ crashlytics.properties
299
+ crashlytics-build.properties
300
+ fabric.properties
301
+
302
+ # Editor-based Rest Client
303
+ .idea/httpRequests
304
+
305
+ # Android studio 3.1+ serialized cache file
306
+ .idea/caches/build_file_checksums.ser
307
+
308
+
309
+ #### emacs ####
310
+ # -*- mode: gitignore; -*-
311
+ *~
312
+ \#*\#
313
+ /.emacs.desktop
314
+ /.emacs.desktop.lock
315
+ *.elc
316
+ auto-save-list
317
+ tramp
318
+ .\#*
319
+
320
+ # Org-mode
321
+ .org-id-locations
322
+ *_archive
323
+
324
+ # flymake-mode
325
+ *_flymake.*
326
+
327
+ # eshell files
328
+ /eshell/history
329
+ /eshell/lastdir
330
+
331
+ # elpa packages
332
+ /elpa/
333
+
334
+ # reftex files
335
+ *.rel
336
+
337
+ # AUCTeX auto folder
338
+ /auto/
339
+
340
+ # cask packages
341
+ .cask/
342
+ dist/
343
+
344
+ # Flycheck
345
+ flycheck_*.el
346
+
347
+ # server auth directory
348
+ /server/
349
+
350
+ # projectiles files
351
+ .projectile
352
+
353
+ # directory configuration
354
+ .dir-locals.el
355
+
356
+ # network security
357
+ /network-security.data
358
+
359
+
360
+
361
+ #### macos ####
362
+ # General
363
+ .DS_Store
364
+ .AppleDouble
365
+ .LSOverride
366
+
367
+ # Icon must end with two \r
368
+ Icon
369
+
370
+
371
+ # Thumbnails
372
+ ._*
373
+
374
+ # Files that might appear in the root of a volume
375
+ .DocumentRevisions-V100
376
+ .fseventsd
377
+ .Spotlight-V100
378
+ .TemporaryItems
379
+ .Trashes
380
+ .VolumeIcon.icns
381
+ .com.apple.timemachine.donotpresent
382
+
383
+ # Directories potentially created on remote AFP share
384
+ .AppleDB
385
+ .AppleDesktop
386
+ Network Trash Folder
387
+ Temporary Items
388
+ .apdisk
data/.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
data/.idea/alma.iml ADDED
@@ -0,0 +1,55 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
10
+ <excludeFolder url="file://$MODULE_DIR$/artifacts" />
11
+ </content>
12
+ <orderEntry type="jdk" jdkName="RVM: ruby-2.7.5" jdkType="RUBY_SDK" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ </component>
15
+ <component name="RModuleSettingsStorage">
16
+ <LOAD_PATH number="2" string0="$MODULE_DIR$/lib" string1="$MODULE_DIR$/spec" />
17
+ <I18N_FOLDERS number="0" />
18
+ </component>
19
+ <component name="RakeTasksCache">
20
+ <option name="myRootTask">
21
+ <RakeTaskImpl id="rake">
22
+ <subtasks>
23
+ <RakeTaskImpl id="bundle">
24
+ <subtasks>
25
+ <RakeTaskImpl description="Updates the ruby-advisory-db then runs bundle-audit" fullCommand="bundle:audit" id="audit" />
26
+ </subtasks>
27
+ </RakeTaskImpl>
28
+ <RakeTaskImpl description="Run all specs in spec directory, with coverage" fullCommand="coverage" id="coverage" />
29
+ <RakeTaskImpl description="Run tests, check test coverage, check code style, check for vulnerabilities, build gem" fullCommand="default" id="default" />
30
+ <RakeTaskImpl description="Build berkeley_library-alma.gemspec as berkeley_library-alma-0.0.1.gem" fullCommand="gem" id="gem" />
31
+ <RakeTaskImpl description="Run RuboCop with auto-correct, and output results to console" fullCommand="ra" id="ra" />
32
+ <RakeTaskImpl description="Run rubocop with HTML output" fullCommand="rubocop" id="rubocop" />
33
+ <RakeTaskImpl id="rubocop">
34
+ <subtasks>
35
+ <RakeTaskImpl description="Auto-correct RuboCop offenses" fullCommand="rubocop:auto_correct" id="auto_correct" />
36
+ </subtasks>
37
+ </RakeTaskImpl>
38
+ <RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
39
+ <RakeTaskImpl id="ci">
40
+ <subtasks>
41
+ <RakeTaskImpl id="setup">
42
+ <subtasks>
43
+ <RakeTaskImpl description="" fullCommand="ci:setup:rspec" id="rspec" />
44
+ <RakeTaskImpl description="" fullCommand="ci:setup:rspecbase" id="rspecbase" />
45
+ <RakeTaskImpl description="" fullCommand="ci:setup:rspecdoc" id="rspecdoc" />
46
+ <RakeTaskImpl description="" fullCommand="ci:setup:spec_report_cleanup" id="spec_report_cleanup" />
47
+ </subtasks>
48
+ </RakeTaskImpl>
49
+ </subtasks>
50
+ </RakeTaskImpl>
51
+ </subtasks>
52
+ </RakeTaskImpl>
53
+ </option>
54
+ </component>
55
+ </module>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,26 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="ConvertOneChainedExprToSafeNavigation" enabled="true" level="INFORMATION" enabled_by_default="true" />
5
+ <inspection_tool class="GoNameStartsWithPackageName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
6
+ <inspection_tool class="GoSnakeCaseUsage" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
7
+ <inspection_tool class="GoUnusedGlobalVariable" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
8
+ <inspection_tool class="GoUnusedVariable" enabled="true" level="WARNING" enabled_by_default="true" />
9
+ <inspection_tool class="GrazieInspection" enabled="false" level="TYPO" enabled_by_default="false" />
10
+ <inspection_tool class="LanguageDetectionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
11
+ <inspection_tool class="Rubocop" enabled="false" level="WARNING" enabled_by_default="false" />
12
+ <inspection_tool class="RubyCaseWithoutElseBlockInspection" enabled="false" level="WARNING" enabled_by_default="false" />
13
+ <inspection_tool class="RubyMismatchedArgumentType" enabled="true" level="WEAK WARNING" enabled_by_default="true">
14
+ <option name="myCheckNilability" value="false" />
15
+ </inspection_tool>
16
+ <inspection_tool class="RubyNilAnalysis" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
17
+ <inspection_tool class="RubyStringKeysInHashInspection" enabled="true" level="INFORMATION" enabled_by_default="true" />
18
+ <inspection_tool class="RubyUnnecessaryReturnStatement" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
19
+ <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
20
+ <option name="processCode" value="true" />
21
+ <option name="processLiterals" value="true" />
22
+ <option name="processComments" value="true" />
23
+ </inspection_tool>
24
+ <inspection_tool class="XmlHighlighting" enabled="true" level="WARNING" enabled_by_default="true" />
25
+ </profile>
26
+ </component>
data/.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.7.2 [global]" project-jdk-type="RUBY_SDK" />
4
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/alma.iml" filepath="$PROJECT_DIR$/.idea/alma.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>