mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-08 07:40:08 +09:00
Upgrade to Rails 8 and Ruby 3.4.5 (#1)
* Bump Ruby to 3.4.5
* Update dependencies
* Adjust for Rails 8 and Ruby 3.5 API changes
* Mark params strings as mutable in prepapration for frozen strings in Ruby 3.5
* Update test for HTML5 sanitizer
With Rails 7.1 the HTML5 sanitizer became the default, this breakts this test because the old sanitizer used to delete unpermitted nodes, while the new one returns their content
The final string is safe, but different then it used to be in Rails 7.0
* Remove direct Turbo tesh helpers require & parallelize tests
* Fix Zeitwerk issues with rails extensions
* Update Resque setup for Redis 5+
* Remove unused views
* Remove GID v1 handler
This commit is contained in:
+2
-22
@@ -1,27 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'brakeman' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
bundle_binstub = File.expand_path("bundle", __dir__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
ARGV.unshift("--ensure-latest")
|
||||
|
||||
load Gem.bin_path("brakeman", "brakeman")
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env ruby
|
||||
require_relative "../config/boot"
|
||||
require "bundler/audit/cli"
|
||||
|
||||
ARGV.concat %w[ --config config/bundler-audit.yml ] if ARGV.empty? || ARGV.include?("check")
|
||||
Bundler::Audit::CLI.start
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env ruby
|
||||
require_relative "../config/boot"
|
||||
require "active_support/continuous_integration"
|
||||
|
||||
CI = ActiveSupport::ContinuousIntegration
|
||||
require_relative "../config/ci.rb"
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env ruby
|
||||
exec "./bin/rails", "server", *ARGV
|
||||
+3
-22
@@ -1,27 +1,8 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
# This file was generated by Bundler.
|
||||
#
|
||||
# The application 'rubocop' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
bundle_binstub = File.expand_path("bundle", __dir__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
||||
load(bundle_binstub)
|
||||
else
|
||||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
||||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
||||
end
|
||||
end
|
||||
|
||||
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")
|
||||
|
||||
@@ -1,45 +1,32 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
#!/usr/bin/env ruby
|
||||
require "fileutils"
|
||||
|
||||
app_root="$( cd "$(dirname "$0")/.."; pwd )"
|
||||
app_name=campfire
|
||||
APP_ROOT = File.expand_path("..", __dir__)
|
||||
|
||||
# Use application binstubs
|
||||
export PATH="$app_root/bin:$PATH"
|
||||
def system!(*args)
|
||||
system(*args, exception: true)
|
||||
end
|
||||
|
||||
announce() {
|
||||
echo
|
||||
echo "--- $@"
|
||||
}
|
||||
|
||||
if [ "$RAILS_ENV" == "production" ]
|
||||
then
|
||||
echo "RAILS_ENV is production; bailing out"
|
||||
if ENV["RAILS_ENV"] == "production"
|
||||
puts "RAILS_ENV is production; bailing out"
|
||||
exit
|
||||
fi
|
||||
end
|
||||
|
||||
announce "Installing dependencies"
|
||||
mise install
|
||||
bundle install
|
||||
FileUtils.chdir APP_ROOT do
|
||||
puts "== Installing dependencies =="
|
||||
system "mise install"
|
||||
system("bundle check") || system!("bundle install")
|
||||
|
||||
announce "Preparing database"
|
||||
if [[ $* == *--reset* ]]; then
|
||||
rm -rf ./storage/{db,files}
|
||||
rails db:migrate:reset
|
||||
else
|
||||
rails db:prepare
|
||||
fi
|
||||
puts "\n== Preparing database =="
|
||||
if ARGV.include?("--reset")
|
||||
system "rm -rf ./storage/{db,files}"
|
||||
system! "bin/rails db:reset"
|
||||
end
|
||||
system! "bin/rails db:prepare"
|
||||
|
||||
announce "Cleaning up old logs, caches, and temporary files"
|
||||
rails log:clear tmp:clear
|
||||
puts "\n== Removing old logs and tempfiles =="
|
||||
system! "bin/rails log:clear tmp:clear"
|
||||
|
||||
announce "Restarting services"
|
||||
rails restart
|
||||
|
||||
if [ -d "$HOME/.puma-dev" ]; then
|
||||
announce "Configuring puma-dev"
|
||||
ln -nfs "$app_root" "$HOME/.puma-dev/$app_name"
|
||||
|
||||
announce "Checking that https://$app_name.test/up is live: "
|
||||
curl -Is "https://$app_name.test/up" | head -n 1
|
||||
fi
|
||||
puts "\n== Restarting services =="
|
||||
system! "bin/rails restart"
|
||||
end
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path("thruster", "thrust")
|
||||
Reference in New Issue
Block a user