Bump rails and drop support for rails < 5.2 (EOL)

This commit is contained in:
Benjamin Neff 2021-06-30 04:00:41 +02:00
parent 636cb9d2ba
commit ecfe0ea850
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
13 changed files with 125 additions and 62 deletions

View file

@ -9,7 +9,7 @@ PATH
valid (~> 1.0) valid (~> 1.0)
diaspora_federation-json_schema (0.2.6) diaspora_federation-json_schema (0.2.6)
diaspora_federation-rails (0.2.6) diaspora_federation-rails (0.2.6)
actionpack (>= 5, < 7) actionpack (>= 5.2, < 7)
diaspora_federation (= 0.2.6) diaspora_federation (= 0.2.6)
diaspora_federation-test (0.2.6) diaspora_federation-test (0.2.6)
diaspora_federation (= 0.2.6) diaspora_federation (= 0.2.6)
@ -19,38 +19,38 @@ PATH
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionpack (6.0.0) actionpack (6.1.4)
actionview (= 6.0.0) actionview (= 6.1.4)
activesupport (= 6.0.0) activesupport (= 6.1.4)
rack (~> 2.0) rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.0) actionview (6.1.4)
activesupport (= 6.0.0) activesupport (= 6.1.4)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (6.0.0) activesupport (6.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 1.6, < 2)
minitest (~> 5.1) minitest (>= 5.1)
tzinfo (~> 1.1) tzinfo (~> 2.0)
zeitwerk (~> 2.1, >= 2.1.8) zeitwerk (~> 2.3)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2) ast (2.4.2)
builder (3.2.3) builder (3.2.4)
byebug (11.1.3) byebug (11.1.3)
coderay (1.1.3) coderay (1.1.3)
concurrent-ruby (1.1.5) concurrent-ruby (1.1.9)
crack (0.4.5) crack (0.4.5)
rexml rexml
crass (1.0.5) crass (1.0.6)
diff-lcs (1.3) diff-lcs (1.3)
docile (1.4.0) docile (1.4.0)
erubi (1.9.0) erubi (1.10.0)
ethon (0.12.0) ethon (0.12.0)
ffi (>= 1.3.0) ffi (>= 1.3.0)
fabrication (2.20.2) fabrication (2.20.2)
@ -80,7 +80,7 @@ GEM
httparty (0.18.1) httparty (0.18.1)
mime-types (~> 3.0) mime-types (~> 3.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (1.7.0) i18n (1.8.10)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json-schema (2.8.1) json-schema (2.8.1)
addressable (>= 2.4) addressable (>= 2.4)
@ -90,7 +90,7 @@ GEM
listen (3.5.1) listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.3.0) loofah (2.10.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
macaddr (1.7.2) macaddr (1.7.2)
@ -100,7 +100,7 @@ GEM
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2021.0225) mime-types-data (3.2021.0225)
mini_portile2 (2.5.3) mini_portile2 (2.5.3)
minitest (5.12.2) minitest (5.14.4)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.1.1) multipart-post (2.1.1)
nokogiri (1.11.7) nokogiri (1.11.7)
@ -141,12 +141,12 @@ GEM
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0) rails-html-sanitizer (1.3.0)
loofah (~> 2.3) loofah (~> 2.3)
railties (6.0.0) railties (6.1.4)
actionpack (= 6.0.0) actionpack (= 6.1.4)
activesupport (= 6.0.0) activesupport (= 6.1.4)
method_source method_source
rake (>= 0.8.7) rake (>= 0.13)
thor (>= 0.20.3, < 2.0) thor (~> 1.0)
rainbow (3.0.0) rainbow (3.0.0)
rake (13.0.3) rake (13.0.3)
rb-fsevent (0.11.0) rb-fsevent (0.11.0)
@ -211,11 +211,10 @@ GEM
terminal-table (1.8.0) terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1) unicode-display_width (~> 1.1, >= 1.1.1)
thor (1.1.0) thor (1.1.0)
thread_safe (0.3.6)
typhoeus (1.4.0) typhoeus (1.4.0)
ethon (>= 0.9.0) ethon (>= 0.9.0)
tzinfo (1.2.5) tzinfo (2.0.4)
thread_safe (~> 0.1) concurrent-ruby (~> 1.0)
unicode-display_width (1.7.0) unicode-display_width (1.7.0)
uuid (2.3.9) uuid (2.3.9)
macaddr (~> 1.0) macaddr (~> 1.0)
@ -225,7 +224,7 @@ GEM
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0) hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.26) yard (0.9.26)
zeitwerk (2.2.0) zeitwerk (2.4.2)
PLATFORMS PLATFORMS
ruby ruby

View file

@ -1,12 +1,14 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. # This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.
ENGINE_ROOT = File.expand_path('../..', __FILE__) ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../../lib/diaspora_federation/engine', __FILE__) ENGINE_PATH = File.expand_path('../lib/diaspora_federation/engine', __dir__)
APP_PATH = File.expand_path('../test/dummy/config/application', __dir__)
# Set up gems listed in the Gemfile. # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
require 'rails/all' require "rails/all"
require 'rails/engine/commands' require "rails/engine/commands"

View file

@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = "~> 2.5" s.required_ruby_version = "~> 2.5"
s.add_dependency "actionpack", ">= 5", "< 7" s.add_dependency "actionpack", ">= 5.2", "< 7"
s.add_dependency "diaspora_federation", DiasporaFederation::VERSION s.add_dependency "diaspora_federation", DiasporaFederation::VERSION
end end

View file

@ -1,4 +1,4 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__) APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot' require_relative "../config/boot"
require 'rails/commands' require "rails/commands"

4
test/dummy/bin/rake Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "rake"
Rake.application.run

25
test/dummy/bin/setup Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env ruby
require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end

View file

@ -2,5 +2,7 @@
# This file is used by Rack-based servers to start the application. # This file is used by Rack-based servers to start the application.
require ::File.expand_path("config/environment", __dir__) require_relative "config/environment"
run Rails.application run Rails.application
Rails.application.load_server

View file

@ -27,9 +27,12 @@ module Dummy
# Initialize configuration defaults for originally generated Rails version. # Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.0 config.load_defaults 5.0
# Settings in config/environments/* take precedence over those specified here. # Configuration for the application, engines, and railties goes here.
# Application configuration can go into files in config/initializers #
# -- all .rb files in that directory are automatically loaded after loading # These settings can be overridden in specific environments using the files
# the framework and any gems in your application. # in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
end end
end end

View file

@ -2,6 +2,5 @@
# Set up gems listed in the Gemfile. # Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile.

View file

@ -1,10 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
require "active_support/core_ext/integer/time"
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on # In the development environment your application's code is reloaded any time
# every request. This slows down response time but is perfect for development # it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes. # since you don't have to restart the web server when you make code changes.
config.cache_classes = false config.cache_classes = false
@ -33,8 +35,17 @@ Rails.application.configure do
# Print deprecation notices to the Rails logger. # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log config.active_support.deprecation = :log
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raises error for missing translations. # Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true # config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
# Use an evented file watcher to asynchronously detect changes in source code, # Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem. # routes, locales, etc. This feature depends on the listen gem.
@ -45,4 +56,7 @@ Rails.application.configure do
# Show the logging configuration on STDOUT # Show the logging configuration on STDOUT
config.show_log_configuration = true config.show_log_configuration = true
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
end end

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "active_support/core_ext/integer/time"
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
@ -25,7 +27,7 @@ Rails.application.configure do
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
# Enable serving of images, stylesheets, and JavaScripts from an asset server. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com' # config.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files. # Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
@ -34,15 +36,9 @@ Rails.application.configure do
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true # config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information # Include generic and useful information about system operation, but avoid logging too much
# when problems arise. # information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :debug config.log_level = :info
# Set the logging destination(s)
config.log_to = %w[file]
# Show the logging configuration on STDOUT
config.show_log_configuration = false
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
config.log_tags = [:request_id] config.log_tags = [:request_id]
@ -61,11 +57,17 @@ Rails.application.configure do
# Send deprecation notices to registered listeners. # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify config.active_support.deprecation = :notify
# Log disallowed deprecations.
config.active_support.disallowed_deprecation = :log
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups. # Use a different logger for distributed setups.
# require 'syslog/logger' # require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present? if ENV["RAILS_LOG_TO_STDOUT"].present?

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's # The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped # your test database is "scratch space" for the test suite and is wiped
@ -8,7 +10,7 @@
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
config.cache_classes = false config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application # Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that # just for the purpose of running a single test. If you are using a tool that
@ -35,6 +37,15 @@ Rails.application.configure do
# Print deprecation notices to the stderr. # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raises error for missing translations. # Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true # config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
end end

View file

@ -3,4 +3,6 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file. # Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password] Rails.application.config.filter_parameters += %i[
passw secret token _key crypt salt certificate otp ssn
]