Skip to content

Commit

Permalink
Merge pull request #25 from ukparliament/update-to-rails-7.2.2
Browse files Browse the repository at this point in the history
Update rails to v7 and bundler too
  • Loading branch information
jamesjefferies authored Dec 12, 2024
2 parents 6e45701 + 484f8e5 commit ee0b7a9
Show file tree
Hide file tree
Showing 19 changed files with 358 additions and 274 deletions.
15 changes: 4 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby file: '.ruby-version'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6'
gem 'rails', '~> 7.2'
# Use sqlite3 as the database for Active Record
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 5.0'
gem 'puma'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
gem 'jbuilder'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false
gem 'bootsnap', require: false

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand Down
185 changes: 110 additions & 75 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,68 +1,82 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
actioncable (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (>= 2.7.1)
actionmailer (6.1.7.10)
actionpack (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.10)
actionview (= 6.1.7.10)
activesupport (= 6.1.7.10)
rack (~> 2.0, >= 2.0.9)
zeitwerk (~> 2.6)
actionmailbox (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
mail (>= 2.8.0)
actionmailer (7.2.2)
actionpack (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activesupport (= 7.2.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.2)
actionview (= 7.2.2)
activesupport (= 7.2.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.10)
actionpack (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.2)
actionpack (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.7.10)
activesupport (= 6.1.7.10)
actionview (7.2.2)
activesupport (= 7.2.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.10)
activesupport (= 6.1.7.10)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.2)
activesupport (= 7.2.2)
globalid (>= 0.3.6)
activemodel (6.1.7.10)
activesupport (= 6.1.7.10)
activerecord (6.1.7.10)
activemodel (= 6.1.7.10)
activesupport (= 6.1.7.10)
activestorage (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activesupport (= 6.1.7.10)
activemodel (7.2.2)
activesupport (= 7.2.2)
activerecord (7.2.2)
activemodel (= 7.2.2)
activesupport (= 7.2.2)
timeout (>= 0.4.0)
activestorage (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activesupport (= 7.2.2)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
activesupport (7.2.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
Expand All @@ -78,9 +92,11 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
date (3.4.0)
diff-lcs (1.5.1)
drb (2.2.1)
erubi (1.13.0)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86_64-darwin)
Expand All @@ -89,6 +105,10 @@ GEM
activesupport (>= 6.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.13.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
Expand All @@ -106,7 +126,6 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.2)
msgpack (1.7.5)
Expand All @@ -127,48 +146,60 @@ GEM
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
pg (1.5.9)
psych (5.2.0)
stringio
public_suffix (6.0.1)
puma (5.6.9)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.10)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.10)
actioncable (= 6.1.7.10)
actionmailbox (= 6.1.7.10)
actionmailer (= 6.1.7.10)
actionpack (= 6.1.7.10)
actiontext (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activemodel (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
rackup (1.0.1)
rack (< 3)
webrick
rails (7.2.2)
actioncable (= 7.2.2)
actionmailbox (= 7.2.2)
actionmailer (= 7.2.2)
actionpack (= 7.2.2)
actiontext (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activemodel (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
bundler (>= 1.15.0)
railties (= 6.1.7.10)
sprockets-rails (>= 2.0.0)
railties (= 7.2.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
method_source
railties (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.8.1)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.12)
io-console (~> 0.5)
rexml (3.3.9)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
Expand Down Expand Up @@ -198,6 +229,7 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
securerandom (0.3.2)
selenium-webdriver (4.26.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand All @@ -211,16 +243,19 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
stringio (3.1.2)
thor (1.3.2)
tilt (2.4.0)
timeout (0.4.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
useragent (0.16.10)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webrick (1.9.0)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
Expand All @@ -238,15 +273,15 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
bootsnap (>= 1.4.4)
bootsnap
byebug
capybara
jbuilder (~> 2.7)
jbuilder
listen (~> 3.3)
pg
puma (~> 5.0)
puma
rack-mini-profiler (~> 2.0)
rails (~> 6)
rails (~> 7.2)
rspec-rails
sass-rails (>= 6)
selenium-webdriver
Expand All @@ -257,4 +292,4 @@ RUBY VERSION
ruby 3.2.1p31

BUNDLED WITH
2.5.21
2.5.23
2 changes: 1 addition & 1 deletion 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"
29 changes: 15 additions & 14 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
#!/usr/bin/env ruby
require "fileutils"

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

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! "gem install bundler --conservative"
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"
# 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'
system! "bin/rails restart"

# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
end
Loading

0 comments on commit ee0b7a9

Please sign in to comment.