From 7fe9741e1fe5de0ed7a5ed63ccf717521263f1ac Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Thu, 25 Dec 2025 20:30:54 -0600 Subject: [PATCH] update to ruby 4.0.0 --- Gemfile | 1 + Gemfile.lock | 249 ++++++++++++++++++--------------------- models/site_file.rb | 2 +- tests/environment.rb | 15 ++- tests/site_file_tests.rb | 8 +- 5 files changed, 136 insertions(+), 139 deletions(-) diff --git a/Gemfile b/Gemfile index b0020372..d18ba0f6 100644 --- a/Gemfile +++ b/Gemfile @@ -22,6 +22,7 @@ gem 'thread' gem 'rest-client', require: 'rest_client' gem 'addressable', '>= 2.8.0', require: 'addressable/uri' gem 'paypal-recurring', require: 'paypal/recurring' +gem 'ostruct' gem 'geoip' gem 'io-extra', require: 'io/extra' #gem 'rye' diff --git a/Gemfile.lock b/Gemfile.lock index a613cc7b..91bc8364 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,33 @@ GEM remote: https://rubygems.org/ specs: - acme-client (2.0.19) - base64 (~> 0.2.0) - faraday (>= 1.0, < 3.0.0) - faraday-retry (>= 1.0, < 3.0.0) - activesupport (8.0.1) + CFPropertyList (2.3.6) + acme-client (2.0.9) + faraday (>= 0.17, < 2.0.0) + activesupport (8.1.1) base64 - benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json logger (>= 1.4.2) minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - adequate_crypto_address (0.1.9) - base58 (~> 0.2) - keccak (~> 1.3) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) + adequate_crypto_address (0.1.0) airbrake (13.0.5) airbrake-ruby (~> 6.0) airbrake-ruby (6.2.2) rbtree3 (~> 0.6) ansi (1.5.0) - base58 (0.2.3) - base64 (0.2.0) + base64 (0.3.0) bcrypt (3.1.20) - benchmark (0.4.0) - bigdecimal (3.1.9) + bigdecimal (4.0.1) builder (3.3.0) capybara (3.40.0) addressable @@ -46,55 +41,51 @@ GEM certified (1.0.0) climate_control (1.2.0) coderay (1.1.3) - concurrent-ruby (1.3.5) - connection_pool (2.5.0) - coveralls_reborn (0.28.0) + concurrent-ruby (1.3.6) + connection_pool (2.5.5) + coveralls_reborn (0.29.0) simplecov (~> 0.22.0) term-ansicolor (~> 1.7) thor (~> 1.2) tins (~> 1.32) - crack (1.0.0) + crack (1.0.1) bigdecimal rexml crass (1.0.6) - csv (3.3.2) + csv (3.3.5) dante (0.2.0) - date (3.4.1) + date (3.5.1) dnsbl-client (1.1.1) docile (1.4.1) domain_name (0.6.20240107) - drb (2.2.1) + drb (2.2.3) erubi (1.13.1) - exifr (1.4.1) - fabrication (2.31.0) - facter (4.10.0) - hocon (~> 1.3) - thor (>= 1.0.1, < 1.3) - faker (3.5.1) + exifr (1.5.1) + fabrication (3.0.0) + facter (2.5.7) + facter (2.5.7-universal-darwin) + CFPropertyList (~> 2.2) + faker (3.5.3) i18n (>= 1.8.11, < 2) - faraday (1.10.4) + faraday (1.8.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) + faraday-httpclient (~> 1.0.1) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) + faraday-net_http_persistent (~> 1.1) faraday-patron (~> 1.0) faraday-rack (~> 1.0) - faraday-retry (~> 1.0) + multipart-post (>= 1.2, < 3) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) + faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.1.0) - multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - faraday-retry (1.0.3) faraday_middleware (1.2.1) faraday (~> 1.0) feedjira (2.1.4) @@ -102,14 +93,7 @@ GEM faraday_middleware (>= 0.9) loofah (>= 2.0) sax-machine (>= 1.0) - ffi (1.17.1-aarch64-linux-gnu) - ffi (1.17.1-aarch64-linux-musl) - ffi (1.17.1-arm-linux-gnu) - ffi (1.17.1-arm-linux-musl) - ffi (1.17.1-arm64-darwin) - ffi (1.17.1-x86_64-darwin) - ffi (1.17.1-x86_64-linux-gnu) - ffi (1.17.1-x86_64-linux-musl) + ffi (1.17.2) ffi-compiler (1.3.2) ffi (>= 1.15.5) rake @@ -119,24 +103,23 @@ GEM hashie xmlrpc geoip (1.6.4) - hashdiff (1.1.2) - hashie (5.0.0) + hashdiff (1.2.1) + hashie (5.1.0) + logger hiredis (0.6.3) - hocon (1.4.0) - hoe (4.2.2) - rake (>= 0.8, < 15.0) - htmlentities (4.3.4) - http (5.2.0) + hoe (4.5.0) + rake (~> 13.0) + htmlentities (4.4.2) + http (5.3.1) addressable (~> 2.8) - base64 (~> 0.1) http-cookie (~> 1.0) http-form_data (~> 2.2) llhttp-ffi (~> 0.5.0) http-accept (1.7.0) - http-cookie (1.0.8) + http-cookie (1.1.0) domain_name (~> 0.5) http-form_data (2.3.0) - i18n (1.14.7) + i18n (1.14.8) concurrent-ruby (~> 1.0) image_optim (0.31.4) exifr (~> 1.2, >= 1.2.2) @@ -144,78 +127,85 @@ GEM image_size (>= 1.5, < 4) in_threads (~> 1.3) progress (~> 3.0, >= 3.0.1) - image_optim_pack (0.11.2) + image_optim_pack (0.12.2.20251207) fspath (>= 2.1, < 4) image_optim (~> 0.19) - image_optim_pack (0.11.2-x86_64-darwin) + image_optim_pack (0.12.2.20251207-arm64-darwin) fspath (>= 2.1, < 4) image_optim (~> 0.19) - image_optim_pack (0.11.2-x86_64-linux) + image_optim_pack (0.12.2.20251207-x86_64-darwin) + fspath (>= 2.1, < 4) + image_optim (~> 0.19) + image_optim_pack (0.12.2.20251207-x86_64-linux) fspath (>= 2.1, < 4) image_optim (~> 0.19) image_optimizer (1.9.0) image_size (3.4.0) in_threads (1.6.0) + io-console (0.8.2) io-extra (1.4.0) ipaddress (0.8.3) - json (2.9.1) - jwt (2.10.1) + json (2.18.0) + jwt (3.1.2) base64 - keccak (1.3.2) - llhttp-ffi (0.5.0) + llhttp-ffi (0.5.1) ffi-compiler (~> 1.0) rake (~> 13.0) logger (1.6.5) - loofah (2.24.0) + loofah (2.25.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - m (1.6.2) - method_source (>= 0.6.7) - rake (>= 0.9.2.2) + m (1.7.0) + rake magic (0.2.9) ffi (>= 0.6.3) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - matrix (0.4.2) - maxmind-db (1.2.0) - maxmind-geoip2 (1.2.0) + matrix (0.4.3) + maxmind-db (1.4.0) + maxmind-geoip2 (1.4.0) connection_pool (~> 2.2) http (>= 4.3, < 6.0) - maxmind-db (~> 1.2) + maxmind-db (~> 1.4) method_source (1.1.0) - mime-types (3.6.0) + mime-types (3.7.0) logger - mime-types-data (~> 3.2015) - mime-types-data (3.2025.0107) - minfraud (2.6.0) + mime-types-data (~> 3.2025, >= 3.2025.0507) + mime-types-data (3.2025.0924) + minfraud (2.9.0) connection_pool (~> 2.2) http (>= 4.3, < 6.0) - maxmind-geoip2 (~> 1.2) + maxmind-geoip2 (~> 1.4) simpleidn (~> 0.1, >= 0.1.1) mini_mime (1.1.5) - minitest (5.25.4) + mini_portile2 (2.8.9) + minitest (6.0.0) + prism (~> 1.5) minitest-reporters (1.7.1) ansi builder minitest (>= 5.0) ruby-progressbar - mocha (2.7.1) + mize (0.6.1) + mocha (3.0.1) ruby2_keywords (>= 0.0.5) - mock_redis (0.49.0) + mock_redis (0.53.0) redis (~> 5) - monetize (1.13.0) - money (~> 6.12) - money (6.19.0) - i18n (>= 0.6.4, <= 2) - msgpack (1.7.5) - multi_json (1.15.0) + monetize (2.0.0) + money (~> 7.0) + money (7.0.2) + bigdecimal + i18n (~> 1.9) + msgpack (1.8.0) + multi_json (1.19.0) multipart-post (2.4.1) mustermann (3.0.4) ruby2_keywords (~> 0.0.1) - net-imap (0.5.7) + net-imap (0.6.2) date net-protocol net-pop (0.1.2) @@ -226,31 +216,19 @@ GEM net-protocol netrc (0.11.0) nio4r (2.7.5) - nokogiri (1.18.9-aarch64-linux-gnu) + nokogiri (1.18.10) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.18.9-aarch64-linux-musl) - racc (~> 1.4) - nokogiri (1.18.9-arm-linux-gnu) - racc (~> 1.4) - nokogiri (1.18.9-arm-linux-musl) - racc (~> 1.4) - nokogiri (1.18.9-arm64-darwin) - racc (~> 1.4) - nokogiri (1.18.9-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-gnu) - racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-musl) - racc (~> 1.4) - ostruct (0.6.1) + ostruct (0.6.3) paypal-recurring (1.1.0) - pg (1.5.9) - phonelib (0.10.3) + pg (1.6.2) + phonelib (0.10.15) + prism (1.7.0) progress (3.6.0) pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (6.0.1) + public_suffix (7.0.0) puma (7.1.0) nio4r (~> 2.0) racc (1.8.1) @@ -267,29 +245,33 @@ GEM rack_session_access (0.2.0) builder (>= 2.0.0) rack (>= 1.0.0) - rake (13.2.1) + rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) rbtree3 (0.7.1) - redis (5.3.0) + readline (0.0.4) + reline + redis (5.4.1) redis-client (>= 0.22.0) - redis-client (0.23.2) + redis-client (0.26.2) connection_pool redis-namespace (1.11.0) redis (>= 4) - regexp_parser (2.10.0) + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.4.2) + rexml (3.4.4) rinku (2.0.6) rszr (1.5.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - rubyzip (2.4.1) + rubyzip (3.2.2) sanitize (7.0.0) crass (~> 1.0.2) nokogiri (>= 1.16.8) @@ -300,30 +282,30 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) sax-machine (1.3.2) securerandom (0.4.1) - selenium-webdriver (4.28.0) + selenium-webdriver (4.39.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2, < 3.0) + rubyzip (>= 1.2.2, < 4.0) websocket (~> 1.0) - sequel (5.89.0) + sequel (5.99.0) bigdecimal - sequel_pg (1.17.1) + sequel_pg (1.18.2) pg (>= 0.18.0, != 1.2.0) sequel (>= 4.38.0) shotgun (0.9.2) rack (>= 1.0) - sidekiq (7.3.8) + sidekiq (7.3.10) base64 - connection_pool (>= 2.3.0) + connection_pool (>= 2.3.0, < 3) logger - rack (>= 2.2.4) - redis-client (>= 0.22.2) + rack (>= 2.2.4, < 3.3) + redis-client (>= 0.23.0, < 1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.1) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) simpleidn (0.2.3) sinatra (4.2.1) @@ -343,35 +325,35 @@ GEM multi_json (~> 1.0) stripe (> 5, < 6) sync (0.5.0) - term-ansicolor (1.11.2) - tins (~> 1.0) - terrapin (1.0.1) + term-ansicolor (1.11.3) + tins (~> 1) + terrapin (1.1.1) climate_control - thor (1.2.2) + thor (1.4.0) thread (0.2.2) tilt (2.6.1) timecop (0.9.10) - timeout (0.4.3) - tins (1.38.0) + timeout (0.6.0) + tins (1.51.0) bigdecimal + mize (~> 0.6) + readline sync - twilio-ruby (7.4.3) - benchmark + twilio-ruby (7.9.0) faraday (>= 0.9, < 3.0) - jwt (>= 1.5, < 3.0) + jwt (>= 1.5, < 4.0) nokogiri (>= 1.6, < 2.0) - ostruct tzinfo (2.0.6) concurrent-ruby (~> 1.0) uri (1.0.3) - webmock (3.25.0) + webmock (3.26.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webp-ffi (0.4.0) ffi (>= 1.9.0) ffi-compiler (>= 0.1.2) - webrick (1.9.1) + webrick (1.9.2) websocket (1.2.11) will_paginate (4.0.1) xmlrpc (0.3.3) @@ -433,6 +415,7 @@ DEPENDENCIES monetize msgpack nokogiri + ostruct paypal-recurring pg phonelib @@ -474,4 +457,4 @@ DEPENDENCIES zip_tricks BUNDLED WITH - 2.6.3 + 4.0.3 diff --git a/models/site_file.rb b/models/site_file.rb index 5118be9c..913e91ae 100644 --- a/models/site_file.rb +++ b/models/site_file.rb @@ -40,7 +40,7 @@ class SiteFile < Sequel::Model begin FileUtils.remove_dir site.files_path(path) - rescue Errno::ENOENT + rescue Errno::ENOENT, Errno::ENOTDIR end else diff --git a/tests/environment.rb b/tests/environment.rb index d4a238d3..182741f2 100644 --- a/tests/environment.rb +++ b/tests/environment.rb @@ -26,6 +26,7 @@ Bundler.require :test #require 'minitest/pride' require 'minitest/autorun' +Minitest.load_plugins require 'webmock' include WebMock::API require 'webmock/minitest' @@ -49,7 +50,19 @@ end Site.bcrypt_cost = BCrypt::Engine::MIN_COST -Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new +class SpecDescriptionReporter < Minitest::Reporters::SpecReporter + private + + def record_print_status(test) + test_name = test.name.sub(/^test_\d+_/, '') + print pad_test(test_name) + print_colored_status(test) + print(" (%.2fs)" % test.time) unless test.time.nil? + puts + end +end + +Minitest::Reporters.use! SpecDescriptionReporter.new # Bootstrap the database Sequel.extension :migration diff --git a/tests/site_file_tests.rb b/tests/site_file_tests.rb index 6d2622fb..9952bfe5 100644 --- a/tests/site_file_tests.rb +++ b/tests/site_file_tests.rb @@ -112,13 +112,13 @@ describe 'site_files' do dir = @site.site_files_dataset.where(path: 'dir').first res = dir.rename('dir/newdir') _(res).must_equal [false, 'cannot move directory into itself'] - _(@site.site_files_dataset.where(path: 'dir').first).wont_equal nil - _(@site.site_files_dataset.where(path: 'dir/newdir').first).must_equal nil + _(@site.site_files_dataset.where(path: 'dir').first).wont_be_nil + _(@site.site_files_dataset.where(path: 'dir/newdir').first).must_be_nil res = dir.rename('dir/sub/dir') _(res).must_equal [false, 'cannot move directory into itself'] - _(@site.site_files_dataset.where(path: 'dir').first).wont_equal nil - _(@site.site_files_dataset.where(path: 'dir/sub/dir').first).must_equal nil + _(@site.site_files_dataset.where(path: 'dir').first).wont_be_nil + _(@site.site_files_dataset.where(path: 'dir/sub/dir').first).must_be_nil end it 'wont set an empty directory' do