Skip to content
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

Update for Rails 8 #479

Merged
merged 12 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AllCops:
NewCops: disable
SuggestExtensions: false
Exclude:
- "test/dummy/db/**/*.rb"
- "test/dummy/**/*"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't care about styling in the dummy app.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?


Naming/FileName:
Exclude:
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gemspec

gem "puma"
gem "sqlite3", "< 2"
gem "sqlite3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2 was causing an issue with Rails 7 previously

gem "debug", ">= 1.7.0"
gem "mocha"
gem "rubocop-shopify", "~> 2.15", require: false
Expand All @@ -17,7 +17,7 @@ gem "rubocop-sorbet", "~> 0.8", require: false
gem "sorbet-static-and-runtime", platforms: :ruby
gem "tapioca", "~> 0.13", require: false, platforms: :ruby
gem "psych", "~> 5.1", require: false
gem "rails"
gem "rails", "8.0.0.beta1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're up to RC2 now, but I will hold off updating until the proper release is out.

gem "webmock"

platforms :mingw, :x64_mingw, :mswin, :jruby do
Expand Down
182 changes: 91 additions & 91 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,87 +7,85 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.3)
actionpack (= 7.1.3.3)
activesupport (= 7.1.3.3)
actioncable (8.0.0.beta1)
actionpack (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.3)
actionpack (= 7.1.3.3)
activejob (= 7.1.3.3)
activerecord (= 7.1.3.3)
activestorage (= 7.1.3.3)
activesupport (= 7.1.3.3)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.3)
actionpack (= 7.1.3.3)
actionview (= 7.1.3.3)
activejob (= 7.1.3.3)
activesupport (= 7.1.3.3)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (8.0.0.beta1)
actionpack (= 8.0.0.beta1)
activejob (= 8.0.0.beta1)
activerecord (= 8.0.0.beta1)
activestorage (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
mail (>= 2.8.0)
actionmailer (8.0.0.beta1)
actionpack (= 8.0.0.beta1)
actionview (= 8.0.0.beta1)
activejob (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.3)
actionview (= 7.1.3.3)
activesupport (= 7.1.3.3)
actionpack (8.0.0.beta1)
actionview (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
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.3)
actionpack (= 7.1.3.3)
activerecord (= 7.1.3.3)
activestorage (= 7.1.3.3)
activesupport (= 7.1.3.3)
useragent (~> 0.16)
actiontext (8.0.0.beta1)
actionpack (= 8.0.0.beta1)
activerecord (= 8.0.0.beta1)
activestorage (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.3)
activesupport (= 7.1.3.3)
actionview (8.0.0.beta1)
activesupport (= 8.0.0.beta1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.3)
activesupport (= 7.1.3.3)
activejob (8.0.0.beta1)
activesupport (= 8.0.0.beta1)
globalid (>= 0.3.6)
activemodel (7.1.3.3)
activesupport (= 7.1.3.3)
activerecord (7.1.3.3)
activemodel (= 7.1.3.3)
activesupport (= 7.1.3.3)
activemodel (8.0.0.beta1)
activesupport (= 8.0.0.beta1)
activerecord (8.0.0.beta1)
activemodel (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
timeout (>= 0.4.0)
activestorage (7.1.3.3)
actionpack (= 7.1.3.3)
activejob (= 7.1.3.3)
activerecord (= 7.1.3.3)
activesupport (= 7.1.3.3)
activestorage (8.0.0.beta1)
actionpack (= 8.0.0.beta1)
activejob (= 8.0.0.beta1)
activerecord (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
marcel (~> 1.0)
activesupport (7.1.3.3)
activesupport (8.0.0.beta1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.3.0)
bigdecimal (3.1.8)
builder (3.2.4)
concurrent-ruby (1.2.3)
builder (3.3.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
Expand All @@ -98,14 +96,14 @@ GEM
irb (~> 1.10)
reline (>= 0.3.8)
drb (2.2.1)
erubi (1.12.0)
erubi (1.13.0)
globalid (1.2.1)
activesupport (>= 6.1)
hashdiff (1.1.0)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.13.1)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
Expand All @@ -121,11 +119,10 @@ GEM
net-smtp
marcel (1.0.4)
mini_mime (1.1.5)
minitest (5.23.0)
minitest (5.25.1)
mocha (2.3.0)
ruby2_keywords (>= 0.0.5)
mutex_m (0.2.0)
net-imap (0.4.11)
net-imap (0.4.16)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -136,13 +133,13 @@ GEM
net-protocol
netrc (0.11.0)
nio4r (2.7.3)
nokogiri (1.16.5-arm64-darwin)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x64-mingw-ucrt)
nokogiri (1.16.7-x64-mingw-ucrt)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-darwin)
nokogiri (1.16.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.1.0)
Expand All @@ -154,40 +151,40 @@ GEM
public_suffix (5.0.5)
puma (6.4.3)
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.11)
racc (1.8.1)
rack (3.1.7)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.3.3)
actioncable (= 7.1.3.3)
actionmailbox (= 7.1.3.3)
actionmailer (= 7.1.3.3)
actionpack (= 7.1.3.3)
actiontext (= 7.1.3.3)
actionview (= 7.1.3.3)
activejob (= 7.1.3.3)
activemodel (= 7.1.3.3)
activerecord (= 7.1.3.3)
activestorage (= 7.1.3.3)
activesupport (= 7.1.3.3)
rails (8.0.0.beta1)
actioncable (= 8.0.0.beta1)
actionmailbox (= 8.0.0.beta1)
actionmailer (= 8.0.0.beta1)
actionpack (= 8.0.0.beta1)
actiontext (= 8.0.0.beta1)
actionview (= 8.0.0.beta1)
activejob (= 8.0.0.beta1)
activemodel (= 8.0.0.beta1)
activerecord (= 8.0.0.beta1)
activestorage (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
bundler (>= 1.15.0)
railties (= 7.1.3.3)
railties (= 8.0.0.beta1)
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 (7.1.3.3)
actionpack (= 7.1.3.3)
activesupport (= 7.1.3.3)
irb
railties (8.0.0.beta1)
actionpack (= 8.0.0.beta1)
activesupport (= 8.0.0.beta1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand All @@ -199,10 +196,10 @@ GEM
sorbet-runtime (>= 0.5.9204)
rbs (3.6.1)
logger
rdoc (6.6.3.1)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.7)
reline (0.5.10)
io-console (~> 0.5)
rexml (3.3.8)
rubocop (1.63.4)
Expand Down Expand Up @@ -234,6 +231,7 @@ GEM
sorbet-runtime (>= 0.5.10782)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
securerandom (0.3.1)
sorbet (0.5.11577)
sorbet-static (= 0.5.11577)
sorbet-runtime (0.5.11577)
Expand All @@ -247,11 +245,11 @@ GEM
prism (>= 0.19.0)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x64-mingw-ucrt)
sqlite3 (1.7.3-x86_64-darwin)
sqlite3 (1.7.3-x86_64-linux)
stringio (3.1.0)
sqlite3 (2.1.0-arm64-darwin)
sqlite3 (2.1.0-x64-mingw-ucrt)
sqlite3 (2.1.0-x86_64-darwin)
sqlite3 (2.1.0-x86_64-linux-gnu)
stringio (3.1.1)
tapioca (0.16.2)
bundler (>= 2.2.25)
netrc (>= 0.11.0)
Expand All @@ -261,13 +259,15 @@ GEM
spoom (>= 1.2.0)
thor (>= 1.2.0)
yard-sorbet
thor (1.3.1)
thor (1.3.2)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2024.1)
tzinfo (>= 1.0.0)
unicode-display_width (2.5.0)
uri (0.13.1)
useragent (0.16.10)
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand All @@ -280,7 +280,7 @@ GEM
yard-sorbet (0.8.1)
sorbet-runtime (>= 0.5)
yard (>= 0.9)
zeitwerk (2.6.14)
zeitwerk (2.6.18)

PLATFORMS
arm64-darwin
Expand All @@ -293,14 +293,14 @@ DEPENDENCIES
mocha
psych (~> 5.1)
puma
rails
rails (= 8.0.0.beta1)
rubocop-minitest (~> 0.35.0)
rubocop-rake (~> 0.6.0)
rubocop-shopify (~> 2.15)
rubocop-sorbet (~> 0.8)
ruby-lsp-rails!
sorbet-static-and-runtime
sqlite3 (< 2)
sqlite3
tapioca (~> 0.13)
tzinfo
tzinfo-data
Expand Down
6 changes: 6 additions & 0 deletions lib/ruby_lsp/ruby_lsp_rails/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

require "json"

if ActionDispatch::Routing::Mapper.respond_to?(:route_source_locations)
ActionDispatch::Routing::Mapper.route_source_locations = true
end

Rails.application.routes.eager_load!

# NOTE: We should avoid printing to stderr since it causes problems. We never read the standard error pipe from the
# client, so it will become full and eventually hang or crash. Instead, return a response with an `error` key.

Expand Down
2 changes: 0 additions & 2 deletions test/dummy/Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

Expand Down
5 changes: 3 additions & 2 deletions test/dummy/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
def create
user_path(1)
Expand All @@ -8,4 +6,7 @@ def create
archive_users_path
invalid_path
end

# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern
end
2 changes: 0 additions & 2 deletions test/dummy/app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# frozen_string_literal: true

andyw8 marked this conversation as resolved.
Show resolved Hide resolved
module ApplicationHelper
end
Loading
Loading