Skip to content

Commit 067aefa

Browse files
committed
Run app:update to implement version changes (5.1 -> 5.2)
1 parent 6876f51 commit 067aefa

File tree

15 files changed

+137
-63
lines changed

15 files changed

+137
-63
lines changed

bin/bundle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env ruby
2-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
33
load Gem.bin_path('bundler', 'bundle')

bin/setup

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env ruby
2-
require 'pathname'
32
require 'fileutils'
43
include FileUtils
54

65
# path to your application root.
7-
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6+
APP_ROOT = File.expand_path('..', __dir__)
87

98
def system!(*args)
109
system(*args) || abort("\n== Command #{args} failed ==")
@@ -21,7 +20,6 @@ chdir APP_ROOT do
2120
# Install JavaScript dependencies if using Yarn
2221
# system('bin/yarn')
2322

24-
2523
# puts "\n== Copying sample files =="
2624
# unless File.exist?('config/database.yml')
2725
# cp 'config/database.yml.sample', 'config/database.yml'

bin/update

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env ruby
2-
require 'pathname'
32
require 'fileutils'
43
include FileUtils
54

65
# path to your application root.
7-
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6+
APP_ROOT = File.expand_path('..', __dir__)
87

98
def system!(*args)
109
system(*args) || abort("\n== Command #{args} failed ==")
@@ -18,6 +17,9 @@ chdir APP_ROOT do
1817
system! 'gem install bundler --conservative'
1918
system('bundle check') || system!('bundle install')
2019

20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
2123
puts "\n== Updating database =="
2224
system! 'bin/rails db:migrate'
2325

bin/yarn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env ruby
2-
VENDOR_PATH = File.expand_path('..', __dir__)
3-
Dir.chdir(VENDOR_PATH) do
2+
APP_ROOT = File.expand_path('..', __dir__)
3+
Dir.chdir(APP_ROOT) do
44
begin
5-
exec "yarnpkg #{ARGV.join(" ")}"
5+
exec "yarnpkg", *ARGV
66
rescue Errno::ENOENT
77
$stderr.puts "Yarn executable was not detected in the system."
88
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"

config/application.rb

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ class Application < Rails::Application
1313
config.load_defaults 5.1
1414

1515
# Settings in config/environments/* take precedence over those specified here.
16-
# Application configuration should go into files in config/initializers
17-
# -- all .rb files in that directory are automatically loaded.
16+
# Application configuration can go into files in config/initializers
17+
# -- all .rb files in that directory are automatically loaded after loading
18+
# the framework and any gems in your application.
1819

1920
# RAILSGOAT SPECIFC CONFIGURATION
2021
# Disable changes to actve_record belongs_to which breaks associations in RailsGoat from 5 onwards
@@ -23,26 +24,6 @@ class Application < Rails::Application
2324
# Disable CSRF protection for RailsGoat
2425
config.action_controller.per_form_csrf_tokens = false
2526

26-
# Configure the default encoding used in templates for Ruby 1.9.
27-
# config.encoding = "utf-8"
28-
29-
# Configure sensitive parameters which will be filtered from the log file.
30-
config.filter_parameters += [:password]
31-
32-
# Enable escaping HTML in JSON.
33-
#config.active_support.escape_html_entities_in_json = true
34-
35-
# Enable the asset pipeline
36-
config.assets.enabled = true
37-
38-
# add app/assets/fonts to the asset path
39-
config.assets.paths << Rails.root.join("app", "assets", "fonts")
40-
41-
# Version of your assets, change this if you want to expire all your assets
42-
config.assets.version = "1.0"
43-
44-
I18n.config.enforce_available_locales = false
45-
4627
# config.action_dispatch.return_only_media_type_on_content_type = false
4728
end
4829
end

config/boot.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
22

33
require 'bundler/setup' # Set up gems listed in the Gemfile.
4+
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

config/cable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ test:
66

77
production:
88
adapter: redis
9-
url: redis://localhost:6379/1
9+
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
1010
channel_prefix: railsgoat_production

config/environments/development.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@
1313
config.consider_all_requests_local = true
1414

1515
# Enable/disable caching. By default caching is disabled.
16-
if Rails.root.join('tmp/caching-dev.txt').exist?
16+
# Run rails dev:cache to toggle caching.
17+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
1718
config.action_controller.perform_caching = true
1819

1920
config.cache_store = :memory_store
2021
config.public_file_server.headers = {
21-
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
22+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
2223
}
2324
else
2425
config.action_controller.perform_caching = false
2526

2627
config.cache_store = :null_store
2728
end
2829

30+
# Store uploaded files on the local file system (see config/storage.yml for options)
31+
config.active_storage.service = :local
32+
2933
# Don't care if the mailer can't send.
3034
config.action_mailer.raise_delivery_errors = false
3135

@@ -37,6 +41,9 @@
3741
# Raise an error on page load if there are pending migrations.
3842
config.active_record.migration_error = :page_load
3943

44+
# Highlight code that triggered database queries in logs.
45+
config.active_record.verbose_query_logs = true
46+
4047
# Debug mode disables concatenation and preprocessing of assets.
4148
# This option may cause significant delays in view rendering with a large
4249
# number of complex assets.

config/environments/production.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
config.consider_all_requests_local = false
1515
config.action_controller.perform_caching = true
1616

17-
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
18-
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
19-
# `config/secrets.yml.key`.
20-
config.read_encrypted_secrets = true
17+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
18+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
19+
# config.require_master_key = true
2120

2221
# Disable serving static files from the `/public` folder by default since
2322
# Apache or NGINX already handles this.
@@ -39,6 +38,9 @@
3938
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
4039
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
4140

41+
# Store uploaded files on the local file system (see config/storage.yml for options)
42+
config.active_storage.service = :local
43+
4244
# Mount Action Cable outside main process or domain
4345
# config.action_cable.mount_path = nil
4446
# config.action_cable.url = 'wss://example.com/cable'
@@ -60,6 +62,7 @@
6062
# Use a real queuing backend for Active Job (and separate queues per environment)
6163
# config.active_job.queue_adapter = :resque
6264
# config.active_job.queue_name_prefix = "railsgoat_#{Rails.env}"
65+
6366
config.action_mailer.perform_caching = false
6467

6568
# Ignore bad email addresses and do not raise email delivery errors.

config/environments/test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Configure public file server for tests with Cache-Control for performance.
1616
config.public_file_server.enabled = true
1717
config.public_file_server.headers = {
18-
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
18+
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
1919
}
2020

2121
# Show full error reports and disable caching.
@@ -27,6 +27,10 @@
2727

2828
# Disable request forgery protection in test environment.
2929
config.action_controller.allow_forgery_protection = false
30+
31+
# Store uploaded files on the local file system in a temporary directory
32+
config.active_storage.service = :test
33+
3034
config.action_mailer.perform_caching = false
3135

3236
# Tell Action Mailer not to deliver emails to the real world.

0 commit comments

Comments
 (0)