Project

General

Profile

Feature #36320 » 0001-Upgrade-to-Rails-7.patch

Takashi Kato, 2022-04-10 15:35

View differences:

Gemfile
source 'https://rubygems.org'
ruby '>= 2.5.0', '< 3.2.0'
ruby '>= 2.7.0', '< 3.2.0'
gem 'bundler', '>= 1.12.0'
gem 'rails', '6.1.5'
gem 'globalid', '~> 0.4.2' if Gem.ruby_version < Gem::Version.new('2.6.0')
gem 'rails', '7.0.2.3'
gem 'rouge', '~> 3.28.0'
gem 'request_store', '~> 1.5.0'
gem 'mini_mime', '~> 1.1.0'
gem "actionpack-xml_parser"
gem 'roadie-rails', (Gem.ruby_version < Gem::Version.new('2.6.0') ? '~> 2.2.0' : '~> 3.0.0')
gem "actionpack-xml_parser", '2.0.1'
gem 'roadie-rails', '~> 3.0.0'
gem 'marcel'
gem "mail", "~> 2.7.1"
gem 'csv', '~> 3.2.0'
gem 'nokogiri', (Gem.ruby_version < Gem::Version.new('2.6.0') ? '~> 1.12.2' : '~> 1.13.0')
gem 'nokogiri', '~> 1.13.0'
gem 'i18n', '~> 1.10.0'
gem "rbpdf", "~> 1.20.0"
gem 'addressable'
......
# Optional CommonMark support, not for JRuby
group :common_mark do
gem "html-pipeline", "~> 2.13.2"
gem "commonmarker", (Gem.ruby_version < Gem::Version.new('2.6.0') ? '0.21.0' : '0.23.1')
gem "commonmarker", '0.23.1'
gem "sanitize", "~> 6.0"
gem 'deckar01-task_list', '2.3.2'
end
......
gem "ffi", platforms: [:mingw, :x64_mingw, :mswin]
# For running system tests
gem 'puma'
gem 'capybara', (Gem.ruby_version < Gem::Version.new('2.6.0') ? '~> 3.35.3' : '~> 3.36.0')
gem "selenium-webdriver", "~> 3.142.7"
gem 'webdrivers', '4.6.1', require: false
gem 'capybara', '~> 3.36.0'
gem "selenium-webdriver", "~> 4.1.0"
gem 'webdrivers', '~> 5.0.0', require: false
# RuboCop
gem 'rubocop', '~> 1.27.0'
gem 'rubocop-performance', '~> 1.13.0'
config/application.rb
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
config.autoloader = :zeitwerk
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
config/initializers/10-patches.rb
end
end
end
class Resolver
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
locals = locals.map(&:to_s).sort!.freeze
cached(key, [name, prefix, partial], details, locals) do
if (details[:formats] & [:xml, :json]).any?
details = details.dup
details[:formats] = details[:formats].dup + [:api]
end
_find_all(name, prefix, partial, details, key, locals)
end
end
end
end
ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| html_tag || ''.html_safe }
......
end
end
module ActionView
LookupContext.prepend(Module.new do
def formats=(values)
if (Array(values) & [:xml, :json]).any?
values << :api
end
super values
end
end)
Rendering.prepend(Module.new do
def rendered_format
if lookup_context.formats.first == :api
return request.format
end
super
end
end)
class Template
Types.singleton_class.prepend(Module.new do
def symbols
super + [:api]
end
end)
end
end
# Adds asset_id parameters to assets like Rails 3 to invalidate caches in browser
module ActionView
module Helpers
test/application_system_test_case.rb
options = {}
# Allow running tests using a remote Selenium hub
options[:url] = ENV['SELENIUM_REMOTE_URL'] if ENV['SELENIUM_REMOTE_URL']
options[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.chrome(
options[:capabilities] = Selenium::WebDriver::Remote::Capabilities.chrome(
'goog:chromeOptions' => {
'args' => GOOGLE_CHROME_OPTS_ARGS,
'prefs' => {
(1-1/13)