Skip to content

Commit

Permalink
upgrade to ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
briri committed Oct 12, 2022
1 parent 7f552c0 commit 0d41bda
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

ruby '>= 2.7'
ruby '>= 3.0'

# ===========#
# CORE RAILS #
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -646,7 +646,7 @@ DEPENDENCIES
yard-tomdoc

RUBY VERSION
ruby 2.7.6p219
ruby 3.0.4p208

BUNDLED WITH
2.3.20
3 changes: 3 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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/*";

Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/variables/_tinymce.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// Import the desired TinyMCE skin name
//@import "lightgray/skin.min";
@import "./colours";
2 changes: 1 addition & 1 deletion app/controllers/concerns/paginable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions app/models/related_identifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions app/models/settings/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
4 changes: 2 additions & 2 deletions config/webpack/environment.js
Original file line number Diff line number Diff line change
@@ -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');

Expand All @@ -12,7 +12,7 @@ environment.plugins.append(
jQuery: 'jquery',
timeago: 'timeago.js',
}),
new ESLintPlugin(),
// new ESLintPlugin(),
);

environment.config.set('resolve.alias', {
Expand Down
2 changes: 1 addition & 1 deletion config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/cleanup/deprecators/get_deprecator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/cleanup/deprecators/predicate_deprecator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/cleanup/deprecators/set_deprecator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/mixins/versionable_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -3157,9 +3157,9 @@ [email protected]:
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"
Expand Down

0 comments on commit 0d41bda

Please sign in to comment.