From 740c7de2d044678b56296a5999cbda1353081789 Mon Sep 17 00:00:00 2001 From: Aaron Elkiss Date: Tue, 3 Oct 2023 12:47:39 -0400 Subject: [PATCH] Update dependencies - ruby 3.2 - address standardrb concerns --- Dockerfile | 4 +- Dockerfile.prod | 2 +- Gemfile.lock | 92 +++++++++++++--------- bin/setup_test.sh | 6 +- lib/collections_database/collections_db.rb | 6 +- lib/rights_database/rights.rb | 2 +- lib/rights_database/rights_db.rb | 6 +- 7 files changed, 65 insertions(+), 53 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f126f0..62c2232 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM ruby:3.1 +FROM ruby:3.2 ARG UNAME=app ARG UID=1000 ARG GID=1000 RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ nodejs \ - netcat + netcat-traditional # COPY Gemfile* /usr/src/app/ diff --git a/Dockerfile.prod b/Dockerfile.prod index 4c1e1ef..77aaea0 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,4 +1,4 @@ -FROM ruby:3.1 +FROM ruby:3.2 LABEL org.opencontainers.image.source https://github.com/hathitrust/hathifiles ARG UNAME=holdings diff --git a/Gemfile.lock b/Gemfile.lock index f0269ad..31a71a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,17 +17,19 @@ GIT GEM remote: https://rubygems.org/ specs: - activesupport (7.0.4.2) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.1) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - canister (0.9.1) + base64 (0.1.1) + bigdecimal (3.1.4) + canister (0.9.2) coderay (1.1.3) - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) deep_merge (1.2.2) diff-lcs (1.5.0) docile (1.4.0) @@ -38,13 +40,14 @@ GEM dotenv (2.8.1) ettin (1.3.0) deep_merge - factory_bot (6.2.1) + factory_bot (6.3.0) activesupport (>= 5.0.0) - faraday (2.7.4) + faraday (2.7.11) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) - ffi (1.15.5) + ffi (1.16.2) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake @@ -58,10 +61,11 @@ GEM domain_name (~> 0.5) http-form_data (2.3.0) httpclient (2.8.3) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.6.3) - language_server-protocol (3.17.0.2) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) llhttp-ffi (0.4.0) ffi-compiler (~> 1.0) rake (~> 13.0) @@ -73,55 +77,59 @@ GEM marc (~> 1.0) method_source (1.0.0) milemarker (1.0.0) - minitest (5.17.0) + minitest (5.20.0) mysql2 (0.5.5) - nokogiri (1.14.0-x86_64-linux) + nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - prometheus-client (4.0.0) + racc + prometheus-client (4.2.1) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.1) - racc (1.6.2) + public_suffix (5.0.3) + racc (1.7.1) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.6.2) - rexml (3.2.5) + regexp_parser (2.8.1) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.3) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-support (3.12.0) - rubocop (1.42.0) + rspec-support (3.12.1) + rubocop (1.56.4) + base64 (~> 0.1.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) scrub_rb (1.0.1) - sequel (5.64.0) + sequel (5.73.0) + bigdecimal simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -129,11 +137,19 @@ GEM simplecov-html (0.12.3) simplecov-lcov (0.8.0) simplecov_json_formatter (0.1.4) - slop (4.9.3) - standard (1.22.1) + slop (4.10.1) + standard (1.31.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.42.0) - rubocop-performance (= 1.15.2) + lint_roller (~> 1.0) + rubocop (~> 1.56.2) + standard-custom (~> 1.0.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.2.0) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.0) standardrb (1.0.1) standard traject (3.8.1) @@ -147,12 +163,12 @@ GEM nokogiri (~> 1.9) slop (~> 4.0) yell - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) yell (2.2.2) PLATFORMS @@ -178,4 +194,4 @@ DEPENDENCIES traject BUNDLED WITH - 2.3.25 + 2.4.20 diff --git a/bin/setup_test.sh b/bin/setup_test.sh index 68bbff7..e812b17 100755 --- a/bin/setup_test.sh +++ b/bin/setup_test.sh @@ -1,4 +1,4 @@ #!/bin/bash -docker-compose build -docker-compose run --rm hf bundle install -docker-compose up -d mariadb pushgateway +docker compose build +docker compose run --rm hf bundle install +docker compose up -d mariadb pushgateway diff --git a/lib/collections_database/collections_db.rb b/lib/collections_database/collections_db.rb index aa9b169..9df0bf3 100644 --- a/lib/collections_database/collections_db.rb +++ b/lib/collections_database/collections_db.rb @@ -13,8 +13,8 @@ class CollectionsDB < SimpleDelegator attr_reader :rawdb attr_accessor :connection_string - def initialize(connection_string = ENV["DB_CONNECTION_STRING"], **kwargs) - @rawdb = self.class.connection(connection_string, **kwargs) + def initialize(connection_string = ENV["DB_CONNECTION_STRING"], **) + @rawdb = self.class.connection(connection_string, **) super(@rawdb) end @@ -43,8 +43,6 @@ def self.connection(connection_string = ENV["DB_CONNECTION_STRING"], else Sequel.connect(connection_string) end - rescue Sequel::DatabaseConnectionError => e - raise e end class << self diff --git a/lib/rights_database/rights.rb b/lib/rights_database/rights.rb index 1a61bea..d33326b 100644 --- a/lib/rights_database/rights.rb +++ b/lib/rights_database/rights.rb @@ -10,7 +10,7 @@ class Rights def initialize(item_id:, attribute: nil, reason: nil, source: nil, time: nil, note: nil, access_profile: nil, user: nil) @item_id = item_id - @namespace, @id = @item_id.split(/\./, 2) + @namespace, @id = @item_id.split(".", 2) if @attribute.nil? load_from_db else diff --git a/lib/rights_database/rights_db.rb b/lib/rights_database/rights_db.rb index cae2a95..a998dff 100644 --- a/lib/rights_database/rights_db.rb +++ b/lib/rights_database/rights_db.rb @@ -16,8 +16,8 @@ class RightsDB < SimpleDelegator attr_reader :rawdb attr_accessor :connection_string - def initialize(connection_string = ENV["DB_CONNECTION_STRING"], **kwargs) - @rawdb = self.class.connection(connection_string, **kwargs) + def initialize(connection_string = ENV["DB_CONNECTION_STRING"], **) + @rawdb = self.class.connection(connection_string, **) super(@rawdb) end @@ -46,8 +46,6 @@ def self.connection(connection_string = ENV["DB_CONNECTION_STRING"], else Sequel.connect(connection_string) end - rescue Sequel::DatabaseConnectionError => e - raise e end class << self