Skip to content

Commit

Permalink
Merge pull request #750 from Fryguy/dummy_rails7
Browse files Browse the repository at this point in the history
Update dummy app to Rails 7.0.8.4
  • Loading branch information
jrafanie authored Aug 30, 2024
2 parents 3de3c4c + 77bea1a commit 08097e7
Show file tree
Hide file tree
Showing 41 changed files with 172 additions and 228 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- '3.0'
- '3.1'
rails-version:
- '6.1'
- '7.0'
services:
postgres:
Expand Down
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ require File.join(Bundler::Plugin.index.load_paths("bundler-inject")[0], "bundle
minimum_version =
case ENV.fetch('TEST_RAILS_VERSION', nil)
when "7.0"
"~>7.0.8"
else
# Default local bundling to use this version for generating migrations
"~>6.1.4"
"~>7.0.8"
end
gem "rails", minimum_version
7 changes: 7 additions & 0 deletions spec/dummy/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
4 changes: 3 additions & 1 deletion spec/dummy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative 'config/application'
require_relative "config/application"

Rails.application.load_tasks
4 changes: 2 additions & 2 deletions spec/dummy/app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* compiled file so the styles you add here take precedence over styles defined in any other CSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
Expand Down
6 changes: 0 additions & 6 deletions spec/dummy/app/javascript/channels/consumer.js

This file was deleted.

5 changes: 0 additions & 5 deletions spec/dummy/app/javascript/channels/index.js

This file was deleted.

17 changes: 0 additions & 17 deletions spec/dummy/app/javascript/packs/application.js

This file was deleted.

4 changes: 2 additions & 2 deletions spec/dummy/app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
default from: "from@example.com"
layout "mailer"
end
2 changes: 1 addition & 1 deletion spec/dummy/app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
primary_abstract_class
end
4 changes: 2 additions & 2 deletions spec/dummy/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html>
<head>
<title>Dummy</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
</head>

<body>
Expand Down
6 changes: 3 additions & 3 deletions spec/dummy/bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
4 changes: 2 additions & 2 deletions spec/dummy/bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
require_relative "../config/boot"
require "rake"
Rake.application.run
27 changes: 12 additions & 15 deletions spec/dummy/bin/setup
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
#!/usr/bin/env ruby
require 'fileutils'
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
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 setup or update your development environment automatically.
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
# 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')

# Install JavaScript dependencies
# system('bin/yarn')
puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end

puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
system! "bin/rails db:prepare"

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! 'bin/rails restart'
system! "bin/rails restart"
end
11 changes: 0 additions & 11 deletions spec/dummy/bin/yarn

This file was deleted.

3 changes: 2 additions & 1 deletion spec/dummy/config.ru
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is used by Rack-based servers to start the application.

require_relative 'config/environment'
require_relative "config/environment"

run Rails.application
Rails.application.load_server
16 changes: 10 additions & 6 deletions spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
require_relative 'boot'
require_relative "boot"

require 'rails/all'
require "rails/all"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults Rails::VERSION::STRING.to_f

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
# 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")

# HACK: Temporary override of the default setting until we can update the
# migration specs to honor it.
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../../Gemfile", __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
require "bundler/setup" # Set up gems listed in the Gemfile.
2 changes: 1 addition & 1 deletion spec/dummy/config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
oiIf1Y+qNWVE1jEKZ4/3Z65QM0K+10X5NxTYTGl+a8lVK+uzvZWieC2L8pY9Mr9APee6Q3sa2vYY/eZxmt8QroCs8IBC/PtS85WGS6gGNA6AJ2pTF3vae+ena4dWXjSWe2pDsgp1N+87qtSTfWHElVZ6v6iPqGcNryiI7BQRsfFk+ViAY57tW9o7nUKAA34TQeELiqTOwUPnCQGnpPc3X+rji+ZAaGPgUeXdWe187x0U8UBL7Hb805Dn2dDahnE3bgCE1lqOdvdsQVk5+mfxQ8wtg3PGba3hPDt/TNx4BnNfzYtmIXpKd8VGZnYs3Ltjd3ZV29Qy3SKp9Lrap2dTTNZ8+djGUJQbl2n7XX9zX4AM77GZ2ZARylQYJxJQykjpcnMd2SgVwfOX6PaiYnFihWpkaj6ag8eV6B5X--6kdjfr/7h6Czlc02--KnWFZqSVFBWitLLXyiUkvg==
Yxkt5W1Zg072FWMc4rrotXZAhLf+tftpT0oyifNXWtku5z42ZVgFQz6OJzZ0JK1r3G0rYEe+UI9Z99c/SQRNK2/8eR1NcU/TeGwWRA5LbFHWz4bZNCmZxls3hHx4Poe/BMGEP8OhMb+R8pHpWzO8U4DwtUbyOJfFnBL+CCaMxiVnKweo1ooUGiZ/U4oYeIwszvbWxcROiWpnitJxwX+xgkeIXhFz1EDrScS45a75MJ3jTW3G2vEJtEHf8Xa1/+/hIjmfkv6v9p1UdX2ff7rlMJtsBkjL8tgJfVX6KGYyD3m3xb+Z8JkqJqZTg3RkV99YvW/4b304xamowtouAH1PJLdielZlRxYkUx1V1iUqYN2IYiO30J7dWljboQewcPJCBLjrPMFaznezIUSkvjvorQjj1HwUyP67sFbv--M74pk+55PaCnIJ9X--Fuq6lUqx7x/TYwWyALv3ZQ==
2 changes: 1 addition & 1 deletion spec/dummy/config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Load the Rails application.
require_relative 'application'
require_relative "application"

# Initialize the Rails application.
Rails.application.initialize!
27 changes: 20 additions & 7 deletions spec/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
require "active_support/core_ext/integer/time"

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 on
# every request. This slows down response time but is perfect for development
# 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.
config.cache_classes = false

Expand All @@ -12,15 +14,18 @@
# Show full error reports.
config.consider_all_requests_local = true

# Enable server timing
config.server_timing = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
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}"
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false
Expand All @@ -39,6 +44,12 @@
# 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

Expand All @@ -48,7 +59,9 @@
# Raises error for missing translations.
# 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.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
end
Loading

0 comments on commit 08097e7

Please sign in to comment.