From 0d41bdad171ca76099a30ec3c02197521941bdec Mon Sep 17 00:00:00 2001 From: briri Date: Wed, 12 Oct 2022 16:35:55 -0700 Subject: [PATCH] upgrade to ruby 3.0 --- Gemfile | 2 +- Gemfile.lock | 4 +-- app/assets/stylesheets/application.scss | 3 ++ .../stylesheets/variables/_tinymce.scss | 1 - app/controllers/concerns/paginable.rb | 2 +- app/models/language.rb | 2 +- app/models/related_identifier.rb | 6 ++-- app/models/settings/template.rb | 4 +-- babel.config.js | 6 ---- config/webpack/environment.js | 4 +-- config/webpacker.yml | 2 +- lib/cleanup/deprecators/get_deprecator.rb | 2 +- .../deprecators/predicate_deprecator.rb | 2 +- lib/cleanup/deprecators/set_deprecator.rb | 2 +- spec/mixins/versionable_model.rb | 2 +- spec/rails_helper.rb | 6 ++-- yarn.lock | 28 +++++++++---------- 17 files changed, 36 insertions(+), 42 deletions(-) diff --git a/Gemfile b/Gemfile index 7fcbf51d10..27dbbdc0b0 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -ruby '>= 2.7' +ruby '>= 3.0' # ===========# # CORE RAILS # diff --git a/Gemfile.lock b/Gemfile.lock index 0c2be81812..9852d9c74c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -506,7 +506,7 @@ GEM tomparse (0.4.2) translation (1.32) gettext (~> 3.2, >= 3.2.5, <= 3.4.3) - turbo-rails (1.3.0) + turbo-rails (1.3.1) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) @@ -646,7 +646,7 @@ DEPENDENCIES yard-tomdoc RUBY VERSION - ruby 2.7.6p219 + ruby 3.0.4p208 BUNDLED WITH 2.3.20 diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 4bb57b09bb..37f3da2faa 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -6,6 +6,9 @@ @import "../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss"; @import "../../../node_modules/bootstrap-select/sass/bootstrap-select.scss"; +// Pull in the webpacker managed copy of TinyMCE Stylesheets +@import "../../../node_modules/tinymce/skins/ui/oxide/*"; + @import "blocks/*"; @import "utils/*"; diff --git a/app/assets/stylesheets/variables/_tinymce.scss b/app/assets/stylesheets/variables/_tinymce.scss index a7c70a7715..0415d1983a 100644 --- a/app/assets/stylesheets/variables/_tinymce.scss +++ b/app/assets/stylesheets/variables/_tinymce.scss @@ -1,3 +1,2 @@ // Import the desired TinyMCE skin name -//@import "lightgray/skin.min"; @import "./colours"; \ No newline at end of file diff --git a/app/controllers/concerns/paginable.rb b/app/controllers/concerns/paginable.rb index ee4ab63730..ecc7960891 100644 --- a/app/controllers/concerns/paginable.rb +++ b/app/controllers/concerns/paginable.rb @@ -8,7 +8,7 @@ module Paginable ## # Regex to validate sort_field param is safe - SORT_COLUMN_FORMAT = /[\w_]+\.[\w_]+$/.freeze + SORT_COLUMN_FORMAT = /[\w_]+\.[\w_]+$/ PAGINATION_QUERY_PARAMS = %i[page sort_field sort_direction search controller action].freeze diff --git a/app/models/language.rb b/app/models/language.rb index 5c2736e525..2db53dce82 100644 --- a/app/models/language.rb +++ b/app/models/language.rb @@ -19,7 +19,7 @@ class Language < ApplicationRecord ABBREVIATION_MAXIMUM_LENGTH = 5 - ABBREVIATION_FORMAT = /\A[a-z]{2}(-[A-Z]{2})?\Z/.freeze + ABBREVIATION_FORMAT = /\A[a-z]{2}(-[A-Z]{2})?\Z/ NAME_MAXIMUM_LENGTH = 20 diff --git a/app/models/related_identifier.rb b/app/models/related_identifier.rb index 9bba3138a5..37428955d7 100644 --- a/app/models/related_identifier.rb +++ b/app/models/related_identifier.rb @@ -26,9 +26,9 @@ class RelatedIdentifier < ApplicationRecord include Uc3Citation - URL_REGEX = /^http/.freeze - DOI_REGEX = %r{(doi:)?10\.[0-9]+/[a-zA-Z0-9.\-/]+}.freeze - ARK_REGEX = %r{ark:[a-zA-Z0-9]+/[a-zA-Z0-9]+}.freeze + URL_REGEX = /^http/ + DOI_REGEX = %r{(doi:)?10\.[0-9]+/[a-zA-Z0-9.\-/]+} + ARK_REGEX = %r{ark:[a-zA-Z0-9]+/[a-zA-Z0-9]+} # ================ # = Associations = diff --git a/app/models/settings/template.rb b/app/models/settings/template.rb index 72ba9b1d0d..a07ce65d95 100644 --- a/app/models/settings/template.rb +++ b/app/models/settings/template.rb @@ -21,8 +21,8 @@ class Template < RailsSettings::SettingObject 'Arial, Helvetica, Sans-Serif' ].freeze - VALID_FONT_SIZE_RANGE = (8..14).freeze - VALID_MARGIN_RANGE = (5..25).freeze + VALID_FONT_SIZE_RANGE = (8..14) + VALID_MARGIN_RANGE = (5..25) VALID_ADMIN_FIELDS = %w[project_name project_identifier grant_title principal_investigator project_data_contact diff --git a/babel.config.js b/babel.config.js index 816b5a63b1..f532ba3da2 100644 --- a/babel.config.js +++ b/babel.config.js @@ -41,12 +41,6 @@ module.exports = function(api) { '@babel/plugin-syntax-dynamic-import', isTestEnv && 'babel-plugin-dynamic-import-node', '@babel/plugin-transform-destructuring', - [ - '@babel/plugin-proposal-private-methods', - { - loose: true - } - ], [ '@babel/plugin-proposal-class-properties', { diff --git a/config/webpack/environment.js b/config/webpack/environment.js index 620aecc4c1..d92a3756a7 100644 --- a/config/webpack/environment.js +++ b/config/webpack/environment.js @@ -1,5 +1,5 @@ const { environment } = require('@rails/webpacker'); -const ESLintPlugin = require('eslint-webpack-plugin'); +// const ESLintPlugin = require('eslint-webpack-plugin'); const erb = require('./loaders/erb'); const webpack = require('webpack'); @@ -12,7 +12,7 @@ environment.plugins.append( jQuery: 'jquery', timeago: 'timeago.js', }), - new ESLintPlugin(), + // new ESLintPlugin(), ); environment.config.set('resolve.alias', { diff --git a/config/webpacker.yml b/config/webpacker.yml index a48dcf4bf2..9735e2a42d 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -11,7 +11,7 @@ default: &default # Additional paths webpack should lookup modules # ['app/assets', 'engine/foo/app/assets'] # DMPTool customization to include the assets in the standard Rails app/assets folder - additional_paths: ['app/assets'] + additional_paths: [] # ['app/assets'] # Reload manifest.json on all requests so we reload latest compiled packs cache_manifest: false diff --git a/lib/cleanup/deprecators/get_deprecator.rb b/lib/cleanup/deprecators/get_deprecator.rb index 673ce28590..f59fd56943 100644 --- a/lib/cleanup/deprecators/get_deprecator.rb +++ b/lib/cleanup/deprecators/get_deprecator.rb @@ -13,7 +13,7 @@ class GetDeprecator # Default message to display to developer when deprecated method called. MESSAGE = '%{deprecated_method} is deprecated. ' \ 'Instead, you should use: %{new_method}. ' \ - "Read #{__FILE__} for more information." + "Read #{__FILE__} for more information.".freeze # Message printed to STDOUT when a deprecated method is called. def deprecation_warning(deprecated_method, _message, _backtrace = nil) diff --git a/lib/cleanup/deprecators/predicate_deprecator.rb b/lib/cleanup/deprecators/predicate_deprecator.rb index ee774fc559..8191363bec 100644 --- a/lib/cleanup/deprecators/predicate_deprecator.rb +++ b/lib/cleanup/deprecators/predicate_deprecator.rb @@ -12,7 +12,7 @@ class PredicateDeprecator # Default message to display to developer when deprecated method called. MESSAGE = '%{deprecated_method} is deprecated. ' \ 'Instead, you should use: %{new_method}. ' \ - "Read #{__FILE__} for more information." + "Read #{__FILE__} for more information.".freeze # Message printed to STDOUT when a deprecated method is called. def deprecation_warning(deprecated_method, _message, _backtrace = nil) diff --git a/lib/cleanup/deprecators/set_deprecator.rb b/lib/cleanup/deprecators/set_deprecator.rb index 28554e311e..33349e9e29 100644 --- a/lib/cleanup/deprecators/set_deprecator.rb +++ b/lib/cleanup/deprecators/set_deprecator.rb @@ -13,7 +13,7 @@ class SetDeprecator # Default message to display to developer when deprecated method called. MESSAGE = '%{deprecated_method} is deprecated. ' \ 'Instead, you should use: %{new_method}. ' \ - "Read #{__FILE__} for more information." + "Read #{__FILE__} for more information.".freeze # Message printed to STDOUT when a deprecated method is called. def deprecation_warning(deprecated_method, _message, _backtrace = nil) diff --git a/spec/mixins/versionable_model.rb b/spec/mixins/versionable_model.rb index 66c6ce883f..aa6ed1c9c1 100644 --- a/spec/mixins/versionable_model.rb +++ b/spec/mixins/versionable_model.rb @@ -2,7 +2,7 @@ require 'rails_helper' -UUID_REGEX = /\A[\w\d]{8}(-[\w\d]{4}){3}-[\w\d]{12}\Z/i.freeze +UUID_REGEX = /\A[\w\d]{8}(-[\w\d]{4}){3}-[\w\d]{12}\Z/i shared_examples_for 'VersionableModel' do context 'attributes' do diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 6d80993be6..b7260d534b 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -27,11 +27,9 @@ # directory. Alternatively, in the individual `*_spec.rb` files, manually # require only the support files necessary. # -Dir[Rails.root.join('spec/support/**/*.rb')].sort { |a, b| a <=> b } - .each { |f| require f } +Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } -Dir[Rails.root.join('spec/mixins/*.rb')].sort { |a, b| a <=> b } - .each { |f| require f } +Dir[Rails.root.join('spec/mixins/*.rb')].each { |f| require f } # Checks for pending migrations and applies them before tests are run. # If you are not using ActiveRecord, you can remove this line.s diff --git a/yarn.lock b/yarn.lock index db2833de01..65ddb584b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -946,17 +946,17 @@ integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== "@hotwired/turbo-rails@^7.1.3": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.2.0.tgz#2081ed4e626fac9fd61ba5a4d1eeb53e6ea93b03" - integrity sha512-RxJJGINeLa2lyI078LLSbqZDI7RarxTDMVlgKnsLvtFEn8Pa7ySEcDUxHp5YiLXGbLacAIH/dcfD0JfCWe5Dqw== + version "7.2.2" + resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.2.2.tgz#577d0d2d8253f395e6c922e3afaf6a9483a75487" + integrity sha512-UlHB++XYlNprpfro4YbywUXFC8QuqH59I+xuU26WMu1mE+RbV2EVS7ARlcUlwzl3PFgsKgJ+xxrJ4HW5gZkJdQ== dependencies: - "@hotwired/turbo" "^7.2.0" + "@hotwired/turbo" "^7.2.2" "@rails/actioncable" "^7.0" -"@hotwired/turbo@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.2.0.tgz#4ff90d80fda17e69b04a12bbf0a42f09953504f6" - integrity sha512-CYr6N9NfqsjhmZx1xVQ8zYcDo4hTm7sTUpJydbNgMRyG+YfF/9ADIQQ2TtcBdkl2zi/12a3OTWX0UMzNZnAK9w== +"@hotwired/turbo@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.2.2.tgz#69e1f4be7f468690fa31791099e2a837e88c9518" + integrity sha512-YfTHwnur3tDFS/D5JYstU+09Z3bvCF6euqqXajHAks2lTSIDbLc8gMp8yLomD+cAC337h1wnv0oWduK6+6pUDw== "@humanwhocodes/config-array@^0.10.5": version "0.10.7" @@ -1233,9 +1233,9 @@ integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== "@types/node@*", "@types/node@>=10.0.0": - version "18.8.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.8.4.tgz#54be907698f40de8a45770b48486aa3cbd3adff7" - integrity sha512-WdlVphvfR/GJCLEMbNA8lJ0lhFNBj4SW3O+O5/cEGw9oYrv0al9zTwuQsq+myDUXgNx2jgBynoVgZ2MMJ6pbow== + version "18.8.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.8.5.tgz#6a31f820c1077c3f8ce44f9e203e68a176e8f59e" + integrity sha512-Bq7G3AErwe5A/Zki5fdD3O6+0zDChhg671NfPjtIcbtzDNZTv4NPKMRFr7gtYPG7y+B8uTiNK4Ngd9T0FTar6Q== "@types/parse-json@^4.0.0": version "4.0.0" @@ -3157,9 +3157,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.251: - version "1.4.277" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.277.tgz#6dc3d9724a0a19b7ab155bf8e37967357a081dc5" - integrity sha512-Ej4VyUfGdVY5D2J5WHAVNqrEFBKgeNcX7p/bBQU4x/VKwvnyEvGd62NEkIK3lykLEe9Cg4MCcoWAa+u97o0u/A== + version "1.4.280" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.280.tgz#1a0d29bf39ffd2719dbacc3cd8d2415a72457490" + integrity sha512-EP8OKK3oXdQs9SURLaEtZUKiLwldZjDfFzFIvrbcqk2otKncds2AYU5fLACbsmvnU2vtn0yU/6ewpxhcMis9gQ== elliptic@^6.5.3: version "6.5.4"