Skip to content

Commit c883745

Browse files
rails app:update changes
1 parent cc509cd commit c883745

12 files changed

+59
-33
lines changed

bin/rails

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/usr/bin/env ruby
2-
begin
3-
load File.expand_path('../spring', __FILE__)
4-
rescue LoadError => e
5-
raise unless e.message.include?('spring')
6-
end
72
APP_PATH = File.expand_path('../config/application', __dir__)
83
require_relative '../config/boot'
94
require 'rails/commands'

bin/rake

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/usr/bin/env ruby
2-
begin
3-
load File.expand_path('../spring', __FILE__)
4-
rescue LoadError => e
5-
raise unless e.message.include?('spring')
6-
end
72
require_relative '../config/boot'
83
require 'rake'
94
Rake.application.run

bin/setup

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env ruby
2-
require "pathname"
32
require "fileutils"
4-
include FileUtils
53

64
# path to your application root.
75
APP_ROOT = File.expand_path("..", __dir__)
@@ -10,7 +8,7 @@ def system!(*args)
108
system(*args) || abort("\n== Command #{args} failed ==")
119
end
1210

13-
chdir APP_ROOT do
11+
FileUtils.chdir APP_ROOT do
1412
# This script is a starting point to setup your application.
1513
# Add necessary setup steps to this file.
1614

bin/update

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env ruby
2-
require "pathname"
32
require "fileutils"
4-
include FileUtils
53

64
# path to your application root.
75
APP_ROOT = File.expand_path("..", __dir__)
@@ -10,7 +8,7 @@ def system!(*args)
108
system(*args) || abort("\n== Command #{args} failed ==")
119
end
1210

13-
chdir APP_ROOT do
11+
FileUtils.chdir APP_ROOT do
1412
# This script is a way to update your development environment automatically.
1513
# Add necessary update steps to this file.
1614

config/cable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ development:
22
adapter: async
33

44
test:
5-
adapter: async
5+
adapter: test
66

77
production:
88
adapter: redis

config/environments/development.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# Run rails dev:cache to toggle caching.
1717
if Rails.root.join("tmp", "caching-dev.txt").exist?
1818
config.action_controller.perform_caching = true
19+
config.action_controller.enable_fragment_cache_logging = true
1920

2021
config.cache_store = :memory_store
2122
config.public_file_server.headers = {
@@ -27,6 +28,9 @@
2728
config.cache_store = :null_store
2829
end
2930

31+
# Store uploaded files on the local file system (see config/storage.yml for options).
32+
config.active_storage.service = :local
33+
3034
# An opinionated ActionMailer config for development:
3135
# - If mailcatcher is running when the app boots, use it.
3236
# - If not, use Rails' built-in :test delivery-method.
@@ -62,7 +66,7 @@
6266
# Suppress logger output for asset requests.
6367
config.assets.quiet = true
6468

65-
# Raises error for missing translations
69+
# Raises error for missing translations.
6670
# config.action_view.raise_on_missing_translations = true
6771

6872
# Use an evented file watcher to asynchronously detect changes in source code,

config/environments/production.rb

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,23 @@
2222
# Apache or NGINX already handles this.
2323
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
2424

25-
# Compress JavaScripts and CSS.
26-
config.assets.js_compressor = :uglifier
25+
# Compress CSS using a preprocessor.
2726
# config.assets.css_compressor = :sass
2827

2928
# Do not fallback to assets pipeline if a precompiled asset is missed.
3029
config.assets.compile = false
3130

32-
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
33-
3431
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
3532
config.action_controller.asset_host = ENV["ASSET_HOST"].presence
3633

3734
# Specifies the header that your server uses for sending files.
3835
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
3936
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
4037

41-
# Store uploaded files on the local file system (see config/storage.yml for options)
38+
# Store uploaded files on the local file system (see config/storage.yml for options).
4239
config.active_storage.service = :local
4340

44-
# Mount Action Cable outside main process or domain
41+
# Mount Action Cable outside main process or domain.
4542
# config.action_cable.mount_path = nil
4643
# config.action_cable.url = 'wss://example.com/cable'
4744
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]

config/environments/test.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
# Show full error reports and disable caching.
2222
config.consider_all_requests_local = true
2323
config.action_controller.perform_caching = false
24+
config.cache_store = :null_store
2425

2526
# Raise exceptions instead of rendering exception templates.
2627
config.action_dispatch.show_exceptions = false
2728

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

31-
# Store uploaded files on the local file system in a temporary directory
32+
# Store uploaded files on the local file system in a temporary directory.
3233
config.active_storage.service = :test
3334

3435
config.action_mailer.perform_caching = false
@@ -43,6 +44,9 @@
4344
# Print deprecation notices to the stderr.
4445
config.active_support.deprecation = :stderr
4546

46-
# Raises error for missing translations
47+
# Raises error for missing translations.
4748
# config.action_view.raise_on_missing_translations = true
49+
50+
# Prevent expensive template finalization at end of test suite runs.
51+
config.action_view.finalize_compiled_template_methods = false
4852
end

config/initializers/content_security_policy.rb

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# policy.object_src :none
1212
# policy.script_src :self, :https
1313
# policy.style_src :self, :https
14+
# # If you are using webpack-dev-server then specify webpack-dev-server host
15+
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
1416

1517
# # Specify URI for violation reports
1618
# # policy.report_uri "/csp-violation-report-endpoint"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Be sure to restart your server when you modify this file.
2+
#
3+
# This file contains migration options to ease your Rails 6.0 upgrade.
4+
#
5+
# Once upgraded flip defaults one by one to migrate to the new default.
6+
#
7+
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
8+
9+
# Don't force requests from old versions of IE to be UTF-8 encoded.
10+
# Rails.application.config.action_view.default_enforce_utf8 = false
11+
12+
# Embed purpose and expiry metadata inside signed and encrypted
13+
# cookies for increased security.
14+
#
15+
# This option is not backwards compatible with earlier Rails versions.
16+
# It's best enabled when your entire app is migrated and stable on 6.0.
17+
# Rails.application.config.action_dispatch.use_cookies_with_metadata = true
18+
19+
# Return false instead of self when enqueuing is aborted from a callback.
20+
# Rails.application.config.active_job.return_false_on_aborted_enqueue = true
21+
22+
# Send Active Storage analysis and purge jobs to dedicated queues.
23+
# Rails.application.config.active_storage.queues.analysis = :active_storage_analysis
24+
# Rails.application.config.active_storage.queues.purge = :active_storage_purge
25+
26+
# Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail.
27+
#
28+
# The default delivery jobs (ActionMailer::Parameterized::DeliveryJob, ActionMailer::DeliveryJob),
29+
# will be removed in Rails 6.1. This setting is not backwards compatible with earlier Rails versions.
30+
# If you send mail in the background, job workers need to have a copy of
31+
# MailDeliveryJob to ensure all delivery jobs are processed properly.
32+
# Make sure your entire app is migrated and stable on 6.0 before using this setting.
33+
# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"

config/locales/en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# 'true': 'foo'
2828
#
2929
# To learn more, please read the Rails Internationalization guide
30-
# available at http://guides.rubyonrails.org/i18n.html.
30+
# available at https://guides.rubyonrails.org/i18n.html.
3131

3232
en:
3333
hello: "Hello world"

config/spring.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%w[
2-
.ruby-version
3-
.rbenv-vars
4-
tmp/restart.txt
5-
tmp/caching-dev.txt
6-
].each { |path| Spring.watch(path) }
1+
Spring.watch(
2+
".ruby-version",
3+
".rbenv-vars",
4+
"tmp/restart.txt",
5+
"tmp/caching-dev.txt"
6+
)

0 commit comments

Comments
 (0)