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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48dcbad64d0cf8be785e5a5a80d210e4f0c77ab14abb4b623c3631607e304c0e
4
- data.tar.gz: afe11b82be536134605bbd67230361f11d547108f3e6fc32c66462922038d9c4
3
+ metadata.gz: 98b996fe16bdc5403b3bc164f4020af94fdebd90ad6564e43a3da0c23ae5c074
4
+ data.tar.gz: 7f2e8333f29178df6e5d57362747d654fb8191b9243d1ad177d610b56e8e34db
5
5
  SHA512:
6
- metadata.gz: 3467d3b3d227a967abf2aae1399900f6fdccba995e139e5d5efd9ba0eaa694e60909122de013fd8670d4c757fb5d294e3b4e8c257e50632c686e1155185521cc
7
- data.tar.gz: 16972421f0101f97d3425a105507e886d5d588a48539ba6a4c32af7675281653268bd6b47df8a7370d5837b106f0a832bc35f54dcfdd1f5d12c1bb7408ba8dd1
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`.
@@ -344,6 +344,8 @@ module Rails
344
344
  if respond_to?(:action_dispatch)
345
345
  action_dispatch.strict_freshness = true
346
346
  end
347
+
348
+ Regexp.timeout ||= 1
347
349
  else
348
350
  raise "Unknown version #{target_version.to_s.inspect}"
349
351
  end
@@ -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, :execute, :updated?, to: :updater
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
- kind = nil if ENV["BACKTRACE"]
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
- kind = nil if ENV["BACKTRACE"]
37
+ return frame if ENV["BACKTRACE"]
38
38
 
39
39
  super(frame, kind)
40
40
  end
@@ -10,7 +10,7 @@ module Rails
10
10
  MAJOR = 8
11
11
  MINOR = 0
12
12
  TINY = 0
13
- PRE = "rc1"
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -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
- cummulative_margin = "\\#{i + 1}[ ]{2}"
520
- blank_or_indented_line = "^[ ]*\n|^#{cummulative_margin}.*\n"
521
- "(?:(?:#{blank_or_indented_line})*?^(#{cummulative_margin})namespace :#{name} do\n#{pattern})?"
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 & Queue setup"
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
@@ -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
@@ -33,7 +33,7 @@ module Authentication
33
33
 
34
34
  def request_authentication
35
35
  session[:return_to_after_authenticating] = request.url
36
- redirect_to new_session_url
36
+ redirect_to new_session_path
37
37
  end
38
38
 
39
39
  def after_authentication_url
@@ -10,7 +10,7 @@ class PasswordsController < ApplicationController
10
10
  PasswordsMailer.reset(user).deliver_later
11
11
  end
12
12
 
13
- redirect_to new_session_url, notice: "Password reset instructions sent (if user with that email address exists)."
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 new_session_url, notice: "Password has been reset."
21
+ redirect_to new_session_path, notice: "Password has been reset."
22
22
  else
23
- redirect_to edit_password_url(params[:token]), alert: "Passwords did not match."
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 new_password_url, alert: "Password reset link is invalid or has expired."
31
+ redirect_to new_password_path, alert: "Password reset link is invalid or has expired."
32
32
  end
33
33
  end
@@ -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 new_session_url, alert: "Try another email address or password."
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 new_session_url
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://aka.ms/devcontainer.json. For config options, see the
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://aka.ms/dev-containers-non-root.
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.rc1
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-10-19 00:00:00.000000000 Z
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.rc1
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.rc1
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.rc1
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.rc1
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.rc1
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.rc1
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.rc1/railties/CHANGELOG.md
494
- documentation_uri: https://api.rubyonrails.org/v8.0.0.rc1/
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.rc1/railties
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.16
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.