-
Notifications
You must be signed in to change notification settings - Fork 384
Upgrade dependencies (rails 8.0 - redis - turbo - stimulus - rubocop) #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
31270c4
1d5db17
3f648e0
0d7e42c
bb2b6cc
5916e01
b88ffab
5d8d5a5
2a896e8
690f2b2
a76a1fe
070602b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,2 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
def installed?(process) | ||
IO.popen "#{process} -v" | ||
rescue Errno::ENOENT | ||
false | ||
end | ||
|
||
def run(process) | ||
system "#{process} start -f Procfile.dev" | ||
rescue Errno::ENOENT | ||
warn <<~MSG | ||
ERROR: | ||
Please ensure `Procfile.dev` exists in your project! | ||
MSG | ||
exit! | ||
end | ||
|
||
if installed? "overmind" | ||
run "overmind" | ||
elsif installed? "foreman" | ||
run "foreman" | ||
else | ||
warn <<~MSG | ||
NOTICE: | ||
For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them. | ||
MSG | ||
exit! | ||
end | ||
exec "./bin/rails", "server", *ARGV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Judahmeek this looks wrong. I don't understand why this was changed. |
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" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
# explicit rubocop config increases performance slightly while avoiding config confusion. | ||
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) | ||
|
||
load Gem.bin_path("rubocop", "rubocop") |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,36 +1,34 @@ | ||||||||||
#!/usr/bin/env ruby | ||||||||||
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 ==") | ||||||||||
system(*args, exception: true) | ||||||||||
end | ||||||||||
|
||||||||||
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 | ||||||||||
system! 'bin/yarn' | ||||||||||
puts "== Installing dependencies ==" | ||||||||||
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" | ||||||||||
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reconsider removing database.yml sample setup Commenting out the database.yml sample copy step might make it harder for new developers to set up the project. Rails 8.0 still uses database.yml for configuration. Consider keeping this functionality with updated sample config: - # puts "\n== Copying sample files =="
- # unless File.exist?("config/database.yml")
- # FileUtils.cp "config/database.yml.sample", "config/database.yml"
- # end
+ puts "\n== Copying sample files =="
+ unless File.exist?("config/database.yml")
+ FileUtils.cp "config/database.yml.sample", "config/database.yml"
+ end 📝 Committable suggestion
Suggested change
|
||||||||||
# 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' | ||||||||||
unless ARGV.include?("--skip-server") | ||||||||||
puts "\n== Starting development server ==" | ||||||||||
STDOUT.flush # flush the output before exec(2) so that it displays | ||||||||||
exec "bin/dev" | ||||||||||
end | ||||||||||
end |
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") |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,3 @@ | ||||||
# frozen_string_literal: true | ||||||
|
||||||
require_relative "boot" | ||||||
|
||||||
require "rails/all" | ||||||
|
@@ -13,10 +11,13 @@ class Application < Rails::Application | |||||
# Initialize configuration defaults for originally generated Rails version. | ||||||
config.load_defaults 7.0 | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update load_defaults to 8.0 The application is still using Rails 7.0 defaults while upgrading to Rails 8.0. This might cause inconsistencies. Apply this change: - config.load_defaults 7.0
+ config.load_defaults 8.0 📝 Committable suggestion
Suggested change
|
||||||
# Configuration for the application, engines, and railties goes here. | ||||||
|
||||||
config.action_cable.allowed_request_origins = [Rails.application.credentials.action_cable_url] | ||||||
# Please, add to the `ignore` list any other `lib` subdirectories that do | ||||||
# not contain `.rb` files, or that should not be reloaded or eager loaded. | ||||||
# Common ones are `templates`, `generators`, or `middleware`, for example. | ||||||
config.autoload_lib(ignore: %w[assets tasks]) | ||||||
|
||||||
# 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. | ||||||
# | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) | ||
|
||
require "bundler/setup" # Set up gems listed in the Gemfile. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
# Load the Rails application. | ||
require_relative "application" | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.