Skip to content

Commit

Permalink
Update to rails 7.2 alpha (#16)
Browse files Browse the repository at this point in the history
* upgrade to rails 7.2 alpha

* upgrade to rails 7.2 alpha

* lint
  • Loading branch information
adrienpoly authored May 12, 2024
1 parent 970687f commit 57b5307
Show file tree
Hide file tree
Showing 21 changed files with 293 additions and 193 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source "https://rubygems.org"
ruby "3.3.1"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.3.2"
gem "rails", github: "rails/rails", branch: "main"

# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
gem "propshaft"
Expand Down Expand Up @@ -51,7 +51,7 @@ group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "byebug"
gem "debug", platforms: %i[mri windows]
gem "standardrb", "~> 1.0"
gem "standard", ">= 1.35.1"
gem "erb_lint"

gem "kamal"
Expand Down Expand Up @@ -98,7 +98,7 @@ gem "dry-types", "~> 1.7"
gem "avo", ">= 3.2"
gem "ransack", "~> 4.1"

gem 'activerecord-enhancedsqlite3-adapter'
gem "activerecord-enhancedsqlite3-adapter"

# sitepress
gem "sitepress-rails", "~> 4.0"
Expand Down
171 changes: 85 additions & 86 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,89 +9,111 @@ GIT
pry-stack_explorer
rails (>= 5.0)

GEM
remote: https://rubygems.org/
GIT
remote: https://github.com/rails/rails.git
revision: 462e9143189ad46d3f26a52d0c132cf69868aa4f
branch: main
specs:
actioncable (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
actioncable (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.2)
actionpack (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activesupport (= 7.1.3.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activestorage (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
mail (>= 2.8.0)
actionmailer (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
actionview (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.2)
actionview (= 7.1.3.2)
activesupport (= 7.1.3.2)
actionpack (7.2.0.alpha)
actionview (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.2)
actionpack (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
useragent (~> 0.16)
actiontext (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activestorage (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.2)
activesupport (= 7.1.3.2)
actionview (7.2.0.alpha)
activesupport (= 7.2.0.alpha)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
active_link_to (1.0.5)
actionpack
addressable
activejob (7.1.3.2)
activesupport (= 7.1.3.2)
activejob (7.2.0.alpha)
activesupport (= 7.2.0.alpha)
globalid (>= 0.3.6)
activemodel (7.1.3.2)
activesupport (= 7.1.3.2)
activerecord (7.1.3.2)
activemodel (= 7.1.3.2)
activesupport (= 7.1.3.2)
activemodel (7.2.0.alpha)
activesupport (= 7.2.0.alpha)
activerecord (7.2.0.alpha)
activemodel (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
timeout (>= 0.4.0)
activerecord-enhancedsqlite3-adapter (0.8.0)
activerecord (>= 7.1)
sqlite3 (>= 1.6)
activestorage (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activesupport (= 7.1.3.2)
activestorage (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
marcel (~> 1.0)
activesupport (7.1.3.2)
activesupport (7.2.0.alpha)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
minitest (>= 5.1, < 5.22.0)
tzinfo (~> 2.0, >= 2.0.5)
rails (7.2.0.alpha)
actioncable (= 7.2.0.alpha)
actionmailbox (= 7.2.0.alpha)
actionmailer (= 7.2.0.alpha)
actionpack (= 7.2.0.alpha)
actiontext (= 7.2.0.alpha)
actionview (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activemodel (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activestorage (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
bundler (>= 1.15.0)
railties (= 7.2.0.alpha)
railties (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)

GEM
remote: https://rubygems.org/
specs:
active_link_to (1.0.5)
actionpack
addressable
activerecord-enhancedsqlite3-adapter (0.8.0)
activerecord (>= 7.1)
sqlite3 (>= 1.6)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ahoy_matey (5.1.0)
Expand Down Expand Up @@ -287,7 +309,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0507)
mini_mime (1.1.5)
minitest (5.22.3)
minitest (5.21.2)
mission_control-jobs (0.1.1)
importmap-rails
rails (~> 7.1)
Expand Down Expand Up @@ -355,20 +377,6 @@ GEM
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.3.2)
actioncable (= 7.1.3.2)
actionmailbox (= 7.1.3.2)
actionmailer (= 7.1.3.2)
actionpack (= 7.1.3.2)
actiontext (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activemodel (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
bundler (>= 1.15.0)
railties (= 7.1.3.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -379,14 +387,6 @@ GEM
rails-i18n (7.0.9)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
ransack (4.1.1)
Expand All @@ -408,7 +408,7 @@ GEM
io-console (~> 0.5)
rexml (3.2.6)
rouge (4.2.1)
rubocop (1.63.5)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -476,10 +476,10 @@ GEM
net-scp (>= 1.1.2)
net-sftp (>= 2.1.2)
net-ssh (>= 2.8.0)
standard (1.35.0.1)
standard (1.35.1)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.62)
rubocop (~> 1.62.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-custom (1.0.2)
Expand All @@ -488,8 +488,6 @@ GEM
standard-performance (1.3.1)
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.2)
standardrb (1.0.1)
standard
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
Expand All @@ -506,6 +504,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
useragent (0.16.10)
view_component (3.12.1)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -561,7 +560,7 @@ DEPENDENCIES
mission_control-jobs (~> 0.1.1)
propshaft
puma (>= 5.0)
rails (~> 7.1.3.2)
rails!
ransack (~> 4.1)
redis (>= 4.0.1)
rouge (~> 4.2)
Expand All @@ -572,7 +571,7 @@ DEPENDENCIES
solid_errors
solid_queue (~> 0.2.2)
sqlite3 (~> 1.4)
standardrb (~> 1.0)
standard (>= 1.35.1)
stimulus-rails
turbo-rails (>= 2.0.0.pre.beta.2)
tzinfo-data
Expand Down
4 changes: 2 additions & 2 deletions app/content/helpers/page_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def with(*args, &block)

# Render a block within a layout. This is a useful, and prefered way, to handle
# nesting layouts, within Sitepress.
def render_layout(layout, **, &block)
render(html: capture(&block), layout: "layouts/#{layout}", **)
def render_layout(layout, **, &)
render(html: capture(&), layout: "layouts/#{layout}", **)
end
end
3 changes: 1 addition & 2 deletions app/markdown/application_markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def youtube_tag(url, alt)
width: 560,
height: 325,
allow: "encrypted-media; picture-in-picture",
allowfullscreen: true \
do
allowfullscreen: true do
alt
end
end
Expand Down
7 changes: 7 additions & 0 deletions bin/brakeman
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

ARGV.unshift("--ensure-latest")

load Gem.bin_path("brakeman", "brakeman")
8 changes: 8 additions & 0 deletions bin/rubocop
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")
16 changes: 10 additions & 6 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
APP_NAME = "daisy_on_rails"

def system!(*args)
system(*args, exception: true)
Expand All @@ -17,9 +17,6 @@ FileUtils.chdir APP_ROOT do
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# Install JavaScript dependencies
system("yarn install --check-files")

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
Expand All @@ -28,9 +25,16 @@ FileUtils.chdir APP_ROOT do
puts "\n== Preparing database =="
system! "bin/rails db:prepare"

puts "\n== Load fixtures =="
system! "bin/rails db:fixtures:load"

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Load fixtures =="
system! "bin/rails db:fixtures:load"
puts "\n== Restarting application server =="
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
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module DaisyOnRails
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1
config.load_defaults 7.2

# 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.
Expand Down
Loading

0 comments on commit 57b5307

Please sign in to comment.