Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support Ruby 3.3 and Rails 7.2 #6913

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .dassie/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
gem 'pg', '~> 1.3'
gem 'puma'
gem 'rails', '~> 6.1'
gem 'rails', '~> 7.2', '< 8.0'
gem 'riiif', '~> 2.1'
gem 'rsolr', '>= 1.0', '< 3'
gem 'sass-rails', '~> 6.0'
Expand All @@ -39,14 +39,14 @@ gem 'turbolinks', '~> 5'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'uglifier', '>= 1.3.0'
gem 'activerecord-nulldb-adapter', git: 'https://github.com/taylorthurlow/nulldb', branch: 'fix/activerecord72-register-adapter'

group :development do
gem 'better_errors' # add command line in browser when errors
gem 'binding_of_caller' # deeper stack trace used by better errors

# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
Expand All @@ -57,4 +57,4 @@ group :development, :test do
gem 'pry-doc'
gem 'pry-rails'
gem 'pry-rescue'
end
end
2 changes: 1 addition & 1 deletion .dassie/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
config.assets.prefix = '/dev-assets'

# Raises error for missing translations
config.action_view.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
Expand Down
6 changes: 4 additions & 2 deletions .dassie/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = Uglifier.new(harmony: true)
# config.assets.css_compressor = :sass
config.assets.configure do |env|
env.js_compressor = :uglifier
# env.css_compressor = :sass
end

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
Expand Down
2 changes: 1 addition & 1 deletion .dassie/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
config.active_support.deprecation = :stderr

# Raises error for missing translations
config.action_view.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true
end
38 changes: 20 additions & 18 deletions .dassie/config/initializers/riiif.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,31 @@
module Hyrax
# Adds file locking to Riiif::File
# @see RiiifFileResolver
class RiiifFile < Riiif::File
include ActiveSupport::Benchmarkable

attr_reader :id
def initialize(input_path, tempfile = nil, id:)
super(input_path, tempfile)
raise(ArgumentError, "must specify id") if id.blank?
@id = id
end
Rails.application.reloader.to_prepare do
class RiiifFile < Riiif::File
include ActiveSupport::Benchmarkable

attr_reader :id
def initialize(input_path, tempfile = nil, id:)
super(input_path, tempfile)
raise(ArgumentError, "must specify id") if id.blank?
@id = id
end

# Wrap extract in a read lock and benchmark it
def extract(transformation, image_info = nil)
Riiif::Image.file_resolver.file_locks[id].with_read_lock do
benchmark "RiiifFile extracted #{path} with #{transformation.to_params}", level: :debug do
super
# Wrap extract in a read lock and benchmark it
def extract(transformation, image_info = nil)
Riiif::Image.file_resolver.file_locks[id].with_read_lock do
benchmark "RiiifFile extracted #{path} with #{transformation.to_params}", level: :debug do
super
end
end
end
end

private
private

def logger
Hyrax.logger
def logger
Hyrax.logger
end
end
end

Expand Down
Loading
Loading