Skip to content

Commit

Permalink
Merge pull request rails#47259 from skipkayhil/hm-regenerate-dummies
Browse files Browse the repository at this point in the history
Full refresh of framework dummy applications
  • Loading branch information
rafaelfranca authored Mar 1, 2023
2 parents 23c134e + 23a459b commit e78ed07
Show file tree
Hide file tree
Showing 115 changed files with 790 additions and 8,329 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ AllCops:
- '**/vendor/**/*'
- 'actionpack/lib/action_dispatch/journey/parser.rb'
- 'actionmailbox/test/dummy/**/*'
- 'activestorage/test/dummy/**/*'
- 'actiontext/test/dummy/**/*'
- '**/node_modules/**/*'

Expand Down
18 changes: 0 additions & 18 deletions actionmailbox/test/dummy/.babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions actionmailbox/test/dummy/.postcssrc.yml

This file was deleted.

1 change: 0 additions & 1 deletion actionmailbox/test/dummy/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
5 changes: 5 additions & 0 deletions actionmailbox/test/dummy/app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked

# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
end
4 changes: 2 additions & 2 deletions actionmailbox/test/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: '[email protected]'
layout 'mailer'
default from: "[email protected]"
layout "mailer"
end
2 changes: 1 addition & 1 deletion actionmailbox/test/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
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +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' %>
<%= javascript_pack_tag 'application' %>
<%= stylesheet_link_tag "application" %>
</head>

<body>
Expand Down
3 changes: 0 additions & 3 deletions actionmailbox/test/dummy/bin/bundle

This file was deleted.

2 changes: 1 addition & 1 deletion actionmailbox/test/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__)
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
27 changes: 12 additions & 15 deletions actionmailbox/test/dummy/bin/setup
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
#!/usr/bin/env ruby
require "fileutils"
include FileUtils

# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args, exception: true)
end

chdir APP_ROOT do
# This script is a starting point to set up your application.
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')

# Install JavaScript dependencies if using Yarn
# 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')
# 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:setup'
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
31 changes: 0 additions & 31 deletions actionmailbox/test/dummy/bin/update

This file was deleted.

11 changes: 0 additions & 11 deletions actionmailbox/test/dummy/bin/yarn

This file was deleted.

1 change: 1 addition & 0 deletions actionmailbox/test/dummy/config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
require_relative "config/environment"

run Rails.application
Rails.application.load_server
17 changes: 12 additions & 5 deletions actionmailbox/test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@

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.
# For compatibility with applications that use this config
config.action_controller.include_all_helpers = false

# 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")
end
end
4 changes: 2 additions & 2 deletions actionmailbox/test/dummy/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 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__)
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
2 changes: 1 addition & 1 deletion actionmailbox/test/dummy/config/cable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ development:
adapter: async

test:
adapter: async
adapter: test

production:
adapter: redis
Expand Down
4 changes: 2 additions & 2 deletions actionmailbox/test/dummy/config/database.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SQLite version 3.x
# SQLite. Versions 3.8.0 and up are supported.
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
# gem "sqlite3"
#
default: &default
adapter: sqlite3
Expand Down
33 changes: 22 additions & 11 deletions actionmailbox/test/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "active_support/core_ext/integer/time"

Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
# config.webpacker.check_yarn_integrity = true
# Settings specified here will take precedence over those in config/application.rb.

# In the development environment your application's code is reloaded any time
Expand All @@ -14,22 +14,26 @@
# 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 bin/rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
# Run rails dev:cache to toggle 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}"
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false

config.cache_store = :null_store
end

# Store uploaded files on the local file system (see config/storage.yml for options)
# 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.
Expand All @@ -40,17 +44,18 @@
# 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

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true

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

Expand All @@ -59,4 +64,10 @@

# 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

# Raise error when a before_action's only/except options reference missing actions
config.action_controller.raise_on_missing_callback_actions = true
end
Loading

0 comments on commit e78ed07

Please sign in to comment.