Skip to content

Commit

Permalink
Merge pull request #119 from igorkasyanchuk/rails8_dummy_app
Browse files Browse the repository at this point in the history
upgrade: rails 8 for the dummy app
  • Loading branch information
igorkasyanchuk authored Nov 27, 2024
2 parents c36e286 + 2c0317a commit 64fa3ec
Show file tree
Hide file tree
Showing 28 changed files with 747 additions and 448 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

strategy:
matrix:
ruby-version: ['3.1', '3.2', '3.3']
ruby-version: ['3.2', '3.3']

steps:
- name: Setup System
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gemspec

# To use a debugger
# gem 'byebug', group: [:development, :test]
gem "rails", "~> 7.2.0"
gem "rails", "8.0.0"

gem "pry"
gem "sqlite3"
Expand Down
124 changes: 59 additions & 65 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,65 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
actioncable (8.0.0)
actionpack (= 8.0.0)
activesupport (= 8.0.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
actionmailbox (8.0.0)
actionpack (= 8.0.0)
activejob (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
mail (>= 2.8.0)
actionmailer (7.2.2)
actionpack (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activesupport (= 7.2.2)
actionmailer (8.0.0)
actionpack (= 8.0.0)
actionview (= 8.0.0)
activejob (= 8.0.0)
activesupport (= 8.0.0)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.2)
actionview (= 7.2.2)
activesupport (= 7.2.2)
actionpack (8.0.0)
actionview (= 8.0.0)
activesupport (= 8.0.0)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.2)
actionpack (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
actiontext (8.0.0)
actionpack (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.2)
activesupport (= 7.2.2)
actionview (8.0.0)
activesupport (= 8.0.0)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.2)
activesupport (= 7.2.2)
activejob (8.0.0)
activesupport (= 8.0.0)
globalid (>= 0.3.6)
activemodel (7.2.2)
activesupport (= 7.2.2)
activerecord (7.2.2)
activemodel (= 7.2.2)
activesupport (= 7.2.2)
activemodel (8.0.0)
activesupport (= 8.0.0)
activerecord (8.0.0)
activemodel (= 8.0.0)
activesupport (= 8.0.0)
timeout (>= 0.4.0)
activestorage (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activesupport (= 7.2.2)
activestorage (8.0.0)
actionpack (= 8.0.0)
activejob (= 8.0.0)
activerecord (= 8.0.0)
activesupport (= 8.0.0)
marcel (~> 1.0)
activesupport (7.2.2)
activesupport (8.0.0)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -80,6 +79,7 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
Expand Down Expand Up @@ -136,9 +136,6 @@ GEM
mustermann-grape (~> 1.1.0)
rack (>= 2)
zeitwerk
hashie (5.0.0)
hashie-forbidden_attributes (0.1.1)
hashie (>= 3.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
Expand Down Expand Up @@ -184,9 +181,6 @@ GEM
racc (~> 1.4)
orm_adapter (0.5.0)
ostruct (0.6.1)
otr-activerecord (2.4.0)
activerecord (>= 6.0, < 7.3)
hashie-forbidden_attributes (~> 0.1)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
Expand All @@ -206,30 +200,30 @@ GEM
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rails (7.2.2)
actioncable (= 7.2.2)
actionmailbox (= 7.2.2)
actionmailer (= 7.2.2)
actionpack (= 7.2.2)
actiontext (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activemodel (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
rails (8.0.0)
actioncable (= 8.0.0)
actionmailbox (= 8.0.0)
actionmailer (= 8.0.0)
actionpack (= 8.0.0)
actiontext (= 8.0.0)
actionview (= 8.0.0)
activejob (= 8.0.0)
activemodel (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
bundler (>= 1.15.0)
railties (= 7.2.2)
railties (= 8.0.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
railties (8.0.0)
actionpack (= 8.0.0)
activesupport (= 8.0.0)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -311,6 +305,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
uri (1.0.2)
useragent (0.16.10)
warden (1.2.9)
rack (>= 2.0.9)
Expand All @@ -319,7 +314,7 @@ GEM
websocket-extensions (0.1.5)
wrapped_print (0.1.1)
activesupport
zeitwerk (2.6.18)
zeitwerk (2.7.1)

PLATFORMS
ruby
Expand All @@ -335,10 +330,9 @@ DEPENDENCIES
grape
mimemagic (= 0.4.3)
ostruct
otr-activerecord
pry
puma
rails (~> 7.2.0)
rails (= 8.0.0)
rails_performance!
sidekiq
simplecov
Expand All @@ -351,4 +345,4 @@ DEPENDENCIES
wrapped_print

BUNDLED WITH
2.4.21
2.4.22
10 changes: 1 addition & 9 deletions lib/rails_performance/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@ class Engine < ::Rails::Engine
initializer "rails_performance.middleware" do |app|
next unless RailsPerformance.enabled

if ::Rails::VERSION::MAJOR.to_i >= 5
app.middleware.insert_after ActionDispatch::Executor, RailsPerformance::Rails::Middleware
else
begin
app.middleware.insert_after ActionDispatch::Static, RailsPerformance::Rails::Middleware
rescue
app.middleware.insert_after Rack::SendFile, RailsPerformance::Rails::Middleware
end
end
app.middleware.insert_after ActionDispatch::Executor, RailsPerformance::Rails::Middleware
# look like it works in reverse order?
app.middleware.insert_before RailsPerformance::Rails::Middleware, RailsPerformance::Rails::MiddlewareTraceStorerAndCleanup

Expand Down
1 change: 0 additions & 1 deletion rails_performance.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "sqlite3"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "grape"
spec.add_development_dependency "otr-activerecord"
spec.add_development_dependency "sidekiq"
spec.add_development_dependency "mimemagic"
spec.add_development_dependency "delayed_job_active_record"
Expand Down
10 changes: 7 additions & 3 deletions test/delayed_job_record_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

class DelayedJobRecordTest < ActiveSupport::TestCase
test "base works" do
User.create.say_hello
Delayed::Worker.new.work_off
assert_nothing_raised do
User.create.say_hello
Delayed::Worker.new.work_off
end
end

test "storage" do
dummy_delayed_job_record.save
assert_nothing_raised do
dummy_delayed_job_record.save
end
end

test "delayed job record test" do
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
AllCops:
TargetRubyVersion: 3.1
TargetRubyVersion: 3.2
2 changes: 1 addition & 1 deletion test/dummy/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.1.2
ruby-3.2.2
2 changes: 2 additions & 0 deletions test/dummy/bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env ruby
exec "./bin/rails", "server", *ARGV
5 changes: 5 additions & 0 deletions test/dummy/bin/thrust
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

load Gem.bin_path("thruster", "thrust")
2 changes: 1 addition & 1 deletion test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.2
config.load_defaults 8.0

config.time_zone = "Europe/Kiev"

Expand Down
33 changes: 12 additions & 21 deletions test/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

# In the development environment your application's code is reloaded any time
# 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.
# Make code changes take effect immediately without server restart.
config.enable_reloading = true

# Do not eager load code on boot.
Expand All @@ -17,53 +15,46 @@
# Enable server timing.
config.server_timing = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
# Run rails dev:cache to toggle Action Controller caching.
if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true

config.cache_store = :memory_store
config.public_file_server.headers = {"Cache-Control" => "public, max-age=#{2.days.to_i}"}
config.public_file_server.headers = {"cache-control" => "public, max-age=#{2.days.to_i}"}
else
config.action_controller.perform_caching = false

config.cache_store = :null_store
end

# Change to :null_store to avoid any caching.
config.cache_store = :memory_store

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

# Disable caching for Action Mailer templates even if Action Controller
# caching is enabled.
# Make template changes take effect immediately.
config.action_mailer.perform_caching = false

# Set localhost to be used by links generated in mailer templates.
config.action_mailer.default_url_options = {host: "localhost", port: 3000}

# Print deprecation notices to the Rails logger.
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 = []

# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load

# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true

# Append comments with runtime information tags to SQL queries in logs.
config.active_record.query_log_tags_enabled = true

# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true

# Suppress logger output for asset requests.
config.assets.quiet = true

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

Expand Down
Loading

0 comments on commit 64fa3ec

Please sign in to comment.