Skip to content

Commit

Permalink
# Support Ruby 3.2. Drop support for Ruby 2.7, Rails 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bshand committed Jun 15, 2023
1 parent 180d26d commit 913dc4b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 73 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ jobs:
strategy:
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
gemfile:
- gemfiles/Gemfile.rails60
- gemfiles/Gemfile.rails61
- gemfiles/Gemfile.rails70

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## [Unreleased]
* No unreleased changes
* Support Ruby 3.2. Drop support for Ruby 2.7, Rails 6.0

## 2.3.1 / 2022-12-02
### Fixed
Expand Down
5 changes: 0 additions & 5 deletions gemfiles/Gemfile.rails60

This file was deleted.

55 changes: 10 additions & 45 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../boot', __FILE__)
require_relative 'boot'

require 'rails/all'

Expand All @@ -7,56 +7,21 @@
module Dummy
# Dummy application to host and test the engine
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.1

# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)

# 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 ]

# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer

# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'

# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = 'utf-8'
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += %i[password dummy_app_test_sensitive_parameter]

# Configure the ActionDispatch::ShowExceptions middleware to use NdrError's exception logger.
config.exceptions_app = NdrError::Recorder.new(::ActionDispatch::PublicExceptions.new(Rails.public_path))

# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true

# Force strong parameters on:
config.action_controller.permit_all_parameters = false

if Rails::VERSION::MAJOR < 6
config.active_record.sqlite3.represent_boolean_as_integer = true
end

# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql

# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
52 changes: 32 additions & 20 deletions test/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,43 +1,55 @@
require 'active_support/core_ext/integer/time'

# The test environment is used exclusively to run your application's
# 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
# and recreated between test runs. Don't rely on the data there!

Dummy::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.

# The test environment is used exclusively to run your application's
# 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
# and recreated between test runs. Don't rely on the data there!
# Turn false under Spring and add config.action_view.cache_template_loading = true.
config.cache_classes = true
config.eager_load = true

# Configure static asset server for tests with Cache-Control for performance
if config.respond_to?(:public_file_server)
config.public_file_server.enabled = true
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
else
config.static_cache_control = 'public, max-age=3600'
config.serve_static_files = true
end
# Eager loading loads your whole application. When running a single test locally,
# this probably isn't necessary. It's a good idea to do in a continuous integration
# system, or in some way before deploying your code.
config.eager_load = ENV['CI'].present?

# Log error messages when you accidentally call methods on nil
config.whiny_nils = true
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{1.hour.to_i}" }

# Don't show error reports, but disable caching
config.consider_all_requests_local = false
config.action_controller.perform_caching = false
config.cache_store = :null_store

# Let middleware intercept errors:
config.action_dispatch.show_exceptions = true

# Disable request forgery protection in test environment
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false

# Randomise test order each time
config.active_support.test_order = :random
config.action_mailer.perform_caching = false

# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

# Print deprecation notices to the stderr
# Print deprecation notices to the 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.
# config.i18n.raise_on_missing_translations = true

# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
end

0 comments on commit 913dc4b

Please sign in to comment.