railties 8.0.0.rc1 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/rails/application/configuration.rb +2 -0
- data/lib/rails/application/routes_reloader.rb +6 -2
- data/lib/rails/backtrace_cleaner.rb +3 -3
- data/lib/rails/gem_version.rb +1 -1
- data/lib/rails/generators/actions.rb +3 -3
- data/lib/rails/generators/app_base.rb +1 -1
- data/lib/rails/generators/rails/app/app_generator.rb +2 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_0.rb.tt +5 -0
- data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +2 -0
- data/lib/rails/generators/rails/authentication/authentication_generator.rb +2 -0
- data/lib/rails/generators/rails/authentication/templates/app/channels/application_cable/connection.rb.tt +16 -0
- data/lib/rails/generators/rails/authentication/templates/app/controllers/concerns/authentication.rb.tt +1 -1
- data/lib/rails/generators/rails/authentication/templates/app/controllers/passwords_controller.rb.tt +4 -4
- data/lib/rails/generators/rails/authentication/templates/app/controllers/sessions_controller.rb.tt +2 -2
- data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +3 -0
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +3 -3
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98b996fe16bdc5403b3bc164f4020af94fdebd90ad6564e43a3da0c23ae5c074
|
4
|
+
data.tar.gz: 7f2e8333f29178df6e5d57362747d654fb8191b9243d1ad177d610b56e8e34db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4981c730953983dc395b6ba77ad9c3b9a9e81ba89e94b32614f6c46737da43092f650fd12eb23ecd62048b7ad9ec58118cfe5723ad02f38f443336ba67809f21
|
7
|
+
data.tar.gz: 93bda06707eebb1f93f6d9b3b97e70a297d87cb34e5efe6215803ea0e1178ec0ae82ccc090c158d651d5f970ad1c0bd7b1d3e8b6de000dfee8a79376d92159ed
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## Rails 8.0.0 (November 07, 2024) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 8.0.0.rc2 (October 30, 2024) ##
|
7
|
+
|
8
|
+
* Fix incorrect database.yml with `skip_solid`.
|
9
|
+
|
10
|
+
*Joé Dupuis*
|
11
|
+
|
12
|
+
* Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks.
|
13
|
+
|
14
|
+
*Rafael Mendonça França*
|
15
|
+
|
16
|
+
|
1
17
|
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
2
18
|
|
3
19
|
* Remove deprecated support to extend Rails console through `Rails::ConsoleMethods`.
|
@@ -10,7 +10,7 @@ module Rails
|
|
10
10
|
attr_reader :route_sets, :paths, :external_routes, :loaded
|
11
11
|
attr_accessor :eager_load
|
12
12
|
attr_writer :run_after_load_paths # :nodoc:
|
13
|
-
delegate :execute_if_updated, :
|
13
|
+
delegate :execute_if_updated, :updated?, to: :updater
|
14
14
|
|
15
15
|
def initialize
|
16
16
|
@paths = []
|
@@ -21,7 +21,6 @@ module Rails
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def reload!
|
24
|
-
@loaded = true
|
25
24
|
clear!
|
26
25
|
load_paths
|
27
26
|
finalize!
|
@@ -30,6 +29,11 @@ module Rails
|
|
30
29
|
revert
|
31
30
|
end
|
32
31
|
|
32
|
+
def execute
|
33
|
+
@loaded = true
|
34
|
+
updater.execute
|
35
|
+
end
|
36
|
+
|
33
37
|
def execute_unless_loaded
|
34
38
|
unless @loaded
|
35
39
|
execute
|
@@ -5,7 +5,7 @@ require "active_support/core_ext/string/access"
|
|
5
5
|
|
6
6
|
module Rails
|
7
7
|
class BacktraceCleaner < ActiveSupport::BacktraceCleaner # :nodoc:
|
8
|
-
APP_DIRS_PATTERN = /\A(?:\.\/)?(?:app|config|lib|test|\(\w*\))/
|
8
|
+
APP_DIRS_PATTERN = /\A(?:\.\/)?(?:app|config|lib|test|\(\w+(?:-\w+)*\))/
|
9
9
|
RENDER_TEMPLATE_PATTERN = /:in [`'].*_\w+_{2,3}\d+_\d+'/
|
10
10
|
|
11
11
|
def initialize
|
@@ -27,14 +27,14 @@ module Rails
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def clean(backtrace, kind = :silent)
|
30
|
-
|
30
|
+
return backtrace if ENV["BACKTRACE"]
|
31
31
|
|
32
32
|
super(backtrace, kind)
|
33
33
|
end
|
34
34
|
alias_method :filter, :clean
|
35
35
|
|
36
36
|
def clean_frame(frame, kind = :silent)
|
37
|
-
|
37
|
+
return frame if ENV["BACKTRACE"]
|
38
38
|
|
39
39
|
super(frame, kind)
|
40
40
|
end
|
data/lib/rails/gem_version.rb
CHANGED
@@ -516,9 +516,9 @@ module Rails
|
|
516
516
|
|
517
517
|
def route_namespace_pattern(namespace)
|
518
518
|
namespace.each_with_index.reverse_each.reduce(nil) do |pattern, (name, i)|
|
519
|
-
|
520
|
-
blank_or_indented_line = "^[ ]*\n|^#{
|
521
|
-
"(?:(?:#{blank_or_indented_line})*?^(#{
|
519
|
+
cumulative_margin = "\\#{i + 1}[ ]{2}"
|
520
|
+
blank_or_indented_line = "^[ ]*\n|^#{cumulative_margin}.*\n"
|
521
|
+
"(?:(?:#{blank_or_indented_line})*?^(#{cumulative_margin})namespace :#{name} do\n#{pattern})?"
|
522
522
|
end.then do |pattern|
|
523
523
|
/^([ ]*).+\.routes\.draw do[ ]*\n#{pattern}/
|
524
524
|
end
|
@@ -110,7 +110,7 @@ module Rails
|
|
110
110
|
desc: "Skip Kamal setup"
|
111
111
|
|
112
112
|
class_option :skip_solid, type: :boolean, default: nil,
|
113
|
-
desc: "Skip Solid Cache
|
113
|
+
desc: "Skip Solid Cache, Queue, and Cable setup"
|
114
114
|
|
115
115
|
class_option :dev, type: :boolean, default: nil,
|
116
116
|
desc: "Set up the #{name} with Gemfile pointing to your Rails checkout"
|
@@ -271,7 +271,8 @@ module Rails
|
|
271
271
|
active_storage: !options[:skip_active_storage],
|
272
272
|
dev: options[:dev],
|
273
273
|
node: using_node?,
|
274
|
-
app_name: app_name
|
274
|
+
app_name: app_name,
|
275
|
+
skip_solid: options[:skip_solid]
|
275
276
|
}
|
276
277
|
|
277
278
|
Rails::Generators::DevcontainerGenerator.new([], devcontainer_options).invoke_all
|
data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_0.rb.tt
CHANGED
@@ -23,3 +23,8 @@
|
|
23
23
|
# If set to `false` both conditions need to be satisfied.
|
24
24
|
#++
|
25
25
|
# Rails.application.config.action_dispatch.strict_freshness = true
|
26
|
+
|
27
|
+
###
|
28
|
+
# Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks.
|
29
|
+
#++
|
30
|
+
# Regexp.timeout = 1
|
@@ -131,6 +131,7 @@ jobs:
|
|
131
131
|
<%- else -%>
|
132
132
|
run: bin/rails db:test:prepare test test:system
|
133
133
|
<%- end -%>
|
134
|
+
<%- unless options[:api] -%>
|
134
135
|
|
135
136
|
- name: Keep screenshots from failed system tests
|
136
137
|
uses: actions/upload-artifact@v4
|
@@ -139,4 +140,5 @@ jobs:
|
|
139
140
|
name: screenshots
|
140
141
|
path: ${{ github.workspace }}/tmp/screenshots
|
141
142
|
if-no-files-found: ignore
|
143
|
+
<%- end -%>
|
142
144
|
<% end -%>
|
@@ -19,6 +19,8 @@ module Rails
|
|
19
19
|
template "app/controllers/concerns/authentication.rb"
|
20
20
|
template "app/controllers/passwords_controller.rb"
|
21
21
|
|
22
|
+
template "app/channels/application_cable/connection.rb" if defined?(ActionCable::Engine)
|
23
|
+
|
22
24
|
template "app/mailers/passwords_mailer.rb"
|
23
25
|
|
24
26
|
template "app/views/passwords_mailer/reset.html.erb"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ApplicationCable
|
2
|
+
class Connection < ActionCable::Connection::Base
|
3
|
+
identified_by :current_user
|
4
|
+
|
5
|
+
def connect
|
6
|
+
set_current_user || reject_unauthorized_connection
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
def set_current_user
|
11
|
+
if session = Session.find_by(id: cookies.signed[:session_id])
|
12
|
+
self.current_user = session.user
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/rails/generators/rails/authentication/templates/app/controllers/passwords_controller.rb.tt
CHANGED
@@ -10,7 +10,7 @@ class PasswordsController < ApplicationController
|
|
10
10
|
PasswordsMailer.reset(user).deliver_later
|
11
11
|
end
|
12
12
|
|
13
|
-
redirect_to
|
13
|
+
redirect_to new_session_path, notice: "Password reset instructions sent (if user with that email address exists)."
|
14
14
|
end
|
15
15
|
|
16
16
|
def edit
|
@@ -18,9 +18,9 @@ class PasswordsController < ApplicationController
|
|
18
18
|
|
19
19
|
def update
|
20
20
|
if @user.update(params.permit(:password, :password_confirmation))
|
21
|
-
redirect_to
|
21
|
+
redirect_to new_session_path, notice: "Password has been reset."
|
22
22
|
else
|
23
|
-
redirect_to
|
23
|
+
redirect_to edit_password_path(params[:token]), alert: "Passwords did not match."
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -28,6 +28,6 @@ class PasswordsController < ApplicationController
|
|
28
28
|
def set_user_by_token
|
29
29
|
@user = User.find_by_password_reset_token!(params[:token])
|
30
30
|
rescue ActiveSupport::MessageVerifier::InvalidSignature
|
31
|
-
redirect_to
|
31
|
+
redirect_to new_password_path, alert: "Password reset link is invalid or has expired."
|
32
32
|
end
|
33
33
|
end
|
data/lib/rails/generators/rails/authentication/templates/app/controllers/sessions_controller.rb.tt
CHANGED
@@ -10,12 +10,12 @@ class SessionsController < ApplicationController
|
|
10
10
|
start_new_session_for user
|
11
11
|
redirect_to after_authentication_url
|
12
12
|
else
|
13
|
-
redirect_to
|
13
|
+
redirect_to new_session_path, alert: "Try another email address or password."
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
def destroy
|
18
18
|
terminate_session
|
19
|
-
redirect_to
|
19
|
+
redirect_to new_session_path
|
20
20
|
end
|
21
21
|
end
|
@@ -29,6 +29,9 @@ module Rails
|
|
29
29
|
class_option :kamal, type: :boolean, default: true,
|
30
30
|
desc: "Include configuration for Kamal"
|
31
31
|
|
32
|
+
class_option :skip_solid, type: :boolean, default: nil,
|
33
|
+
desc: "Skip Solid Cache, Queue, and Cable setup"
|
34
|
+
|
32
35
|
source_paths << File.expand_path(File.join(base_name, "app", "templates"), base_root)
|
33
36
|
|
34
37
|
def create_devcontainer
|
@@ -1,5 +1,5 @@
|
|
1
|
-
// For format details, see https://
|
2
|
-
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
1
|
+
// For format details, see https://containers.dev/implementors/json_reference/.
|
2
|
+
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
3
3
|
{
|
4
4
|
"name": "<%= options[:app_name] %>",
|
5
5
|
"dockerComposeFile": "compose.yaml",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
// Configure tool-specific properties.
|
24
24
|
// "customizations": {},
|
25
25
|
|
26
|
-
// Uncomment to connect as root instead. More info: https://
|
26
|
+
// Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.
|
27
27
|
// "remoteUser": "root",
|
28
28
|
|
29
29
|
<%- if !mounts.empty? -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railties
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.0
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 8.0.0
|
19
|
+
version: 8.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 8.0.0
|
26
|
+
version: 8.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 8.0.0
|
33
|
+
version: 8.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 8.0.0
|
40
|
+
version: 8.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rackup
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,14 +120,14 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - '='
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: 8.0.0
|
123
|
+
version: 8.0.0
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - '='
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: 8.0.0
|
130
|
+
version: 8.0.0
|
131
131
|
description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
|
132
132
|
email: david@loudthinking.com
|
133
133
|
executables:
|
@@ -318,6 +318,7 @@ files:
|
|
318
318
|
- lib/rails/generators/rails/application_record/application_record_generator.rb
|
319
319
|
- lib/rails/generators/rails/authentication/USAGE
|
320
320
|
- lib/rails/generators/rails/authentication/authentication_generator.rb
|
321
|
+
- lib/rails/generators/rails/authentication/templates/app/channels/application_cable/connection.rb.tt
|
321
322
|
- lib/rails/generators/rails/authentication/templates/app/controllers/concerns/authentication.rb.tt
|
322
323
|
- lib/rails/generators/rails/authentication/templates/app/controllers/passwords_controller.rb.tt
|
323
324
|
- lib/rails/generators/rails/authentication/templates/app/controllers/sessions_controller.rb.tt
|
@@ -490,10 +491,10 @@ licenses:
|
|
490
491
|
- MIT
|
491
492
|
metadata:
|
492
493
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
493
|
-
changelog_uri: https://github.com/rails/rails/blob/v8.0.0
|
494
|
-
documentation_uri: https://api.rubyonrails.org/v8.0.0
|
494
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.0.0/railties/CHANGELOG.md
|
495
|
+
documentation_uri: https://api.rubyonrails.org/v8.0.0/
|
495
496
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
496
|
-
source_code_uri: https://github.com/rails/rails/tree/v8.0.0
|
497
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.0.0/railties
|
497
498
|
rubygems_mfa_required: 'true'
|
498
499
|
post_install_message:
|
499
500
|
rdoc_options:
|
@@ -512,7 +513,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
512
513
|
- !ruby/object:Gem::Version
|
513
514
|
version: '0'
|
514
515
|
requirements: []
|
515
|
-
rubygems_version: 3.5.
|
516
|
+
rubygems_version: 3.5.22
|
516
517
|
signing_key:
|
517
518
|
specification_version: 4
|
518
519
|
summary: Tools for creating, working with, and running Rails applications.
|