railties 7.2.1.2 → 7.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/rails/commands/console/irb_console.rb +12 -2
- data/lib/rails/engine.rb +2 -2
- data/lib/rails/gem_version.rb +2 -2
- data/lib/rails/generators/rails/app/app_generator.rb +0 -4
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +3 -0
- data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +1 -1
- data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +1 -1
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +4 -2
- data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +2 -2
- data/lib/rails/generators.rb +6 -2
- data/lib/rails/info_controller.rb +4 -2
- data/lib/rails/railtie.rb +13 -13
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b42e5edbadc1d7dd623733b6009ce427f9358cef2697d0e805c8bed83b560646
|
4
|
+
data.tar.gz: 7148416dc0ecedf061563bad3666916b0eee3f9afa3d4af662a874b786155314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633bc1e137530a7a6913f7354e5a2aa21950335ec941d7421dda555b39a392a59025fd7e3fcf6c0b24f557f22f39c735a4c2d4dfdd6fe6d88cd7279b0d6a558c
|
7
|
+
data.tar.gz: c83e214d7e6830fa391445af58ef89a1d3d1a751688934025760e857a67036964352745327d5bc4588d83affe950e193b8ee8781dd1f0da868db791ae6c0c23d
|
data/CHANGELOG.md
CHANGED
@@ -51,7 +51,16 @@ module Rails
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
class
|
54
|
+
class ReloadHelper < RailsHelperBase
|
55
|
+
description "Reloads the Rails application."
|
56
|
+
|
57
|
+
def execute
|
58
|
+
puts "Reloading..."
|
59
|
+
Rails.application.reloader.reload!
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
class ReloadCommand < IRB::Command::Base
|
55
64
|
include ConsoleMethods
|
56
65
|
|
57
66
|
category "Rails console"
|
@@ -67,7 +76,8 @@ module Rails
|
|
67
76
|
IRB::HelperMethod.register(:controller, ControllerInstance)
|
68
77
|
IRB::HelperMethod.register(:new_session, NewSession)
|
69
78
|
IRB::HelperMethod.register(:app, AppInstance)
|
70
|
-
IRB::
|
79
|
+
IRB::HelperMethod.register(:reload!, ReloadHelper)
|
80
|
+
IRB::Command.register(:reload!, ReloadCommand)
|
71
81
|
|
72
82
|
class IRBConsole
|
73
83
|
def initialize(app)
|
data/lib/rails/engine.rb
CHANGED
@@ -643,9 +643,9 @@ module Rails
|
|
643
643
|
end
|
644
644
|
end
|
645
645
|
|
646
|
-
initializer :
|
646
|
+
initializer :wrap_reloader_around_load_seed do |app|
|
647
647
|
self.class.set_callback(:load_seed, :around) do |engine, seeds_block|
|
648
|
-
app.
|
648
|
+
app.reloader.wrap(&seeds_block)
|
649
649
|
end
|
650
650
|
end
|
651
651
|
|
data/lib/rails/gem_version.rb
CHANGED
@@ -286,10 +286,6 @@ module Rails
|
|
286
286
|
end
|
287
287
|
|
288
288
|
module Generators
|
289
|
-
# We need to store the RAILS_DEV_PATH in a constant, otherwise the path
|
290
|
-
# can change in Ruby 1.8.7 when we FileUtils.cd.
|
291
|
-
RAILS_DEV_PATH = File.expand_path("../../../../../..", __dir__)
|
292
|
-
|
293
289
|
class AppGenerator < AppBase
|
294
290
|
# :stopdoc:
|
295
291
|
|
@@ -54,7 +54,7 @@ group :development do
|
|
54
54
|
<%- if RUBY_VERSION < "3.2" -%>
|
55
55
|
|
56
56
|
# Highlight the fine-grained location where an error occurred [https://github.com/ruby/error_highlight]
|
57
|
-
gem "error_highlight", ">= 0.4.0", platforms: [:ruby]
|
57
|
+
gem "error_highlight", ">= 0.4.0", platforms: [ :ruby ]
|
58
58
|
<%- end -%>
|
59
59
|
end
|
60
60
|
<%- end -%>
|
@@ -104,6 +104,9 @@ Rails.application.configure do
|
|
104
104
|
|
105
105
|
# Do not dump schema after migrations.
|
106
106
|
config.active_record.dump_schema_after_migration = false
|
107
|
+
|
108
|
+
# Only use :id for inspections in production.
|
109
|
+
config.active_record.attributes_for_inspect = [ :id ]
|
107
110
|
<%- end -%>
|
108
111
|
|
109
112
|
# Enable DNS rebinding protection and other `Host` header attacks.
|
@@ -491,9 +491,11 @@ module Rails
|
|
491
491
|
|
492
492
|
def test_command
|
493
493
|
if engine? && !options[:skip_active_record] && with_dummy_app?
|
494
|
-
"db:test:prepare test"
|
494
|
+
"bin/rails db:test:prepare test"
|
495
|
+
elsif engine?
|
496
|
+
"bin/rails test"
|
495
497
|
else
|
496
|
-
"test"
|
498
|
+
"bin/test"
|
497
499
|
end
|
498
500
|
end
|
499
501
|
end
|
@@ -90,7 +90,7 @@ jobs:
|
|
90
90
|
DATABASE_URL: postgres://postgres:postgres@localhost:5432
|
91
91
|
<%- end -%>
|
92
92
|
# REDIS_URL: redis://localhost:6379/0
|
93
|
-
run:
|
93
|
+
run: <%= test_command %>
|
94
94
|
|
95
95
|
- name: Keep screenshots from failed system tests
|
96
96
|
uses: actions/upload-artifact@v4
|
@@ -3,7 +3,7 @@ ENV["RAILS_ENV"] = "test"
|
|
3
3
|
|
4
4
|
require_relative "<%= File.join("..", options[:dummy_path], "config/environment") -%>"
|
5
5
|
<% unless options[:skip_active_record] -%>
|
6
|
-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../<%= options[:dummy_path] -%>/db/migrate", __dir__)]
|
6
|
+
ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../<%= options[:dummy_path] -%>/db/migrate", __dir__) ]
|
7
7
|
<% if options[:mountable] -%>
|
8
8
|
ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)
|
9
9
|
<% end -%>
|
@@ -13,7 +13,7 @@ require "rails/test_help"
|
|
13
13
|
<% unless options[:skip_active_record] -%>
|
14
14
|
# Load fixtures from the engine
|
15
15
|
if ActiveSupport::TestCase.respond_to?(:fixture_paths=)
|
16
|
-
ActiveSupport::TestCase.fixture_paths = [File.expand_path("fixtures", __dir__)]
|
16
|
+
ActiveSupport::TestCase.fixture_paths = [ File.expand_path("fixtures", __dir__) ]
|
17
17
|
ActionDispatch::IntegrationTest.fixture_paths = ActiveSupport::TestCase.fixture_paths
|
18
18
|
ActiveSupport::TestCase.file_fixture_path = File.expand_path("fixtures", __dir__) + "/files"
|
19
19
|
ActiveSupport::TestCase.fixtures :all
|
data/lib/rails/generators.rb
CHANGED
@@ -23,7 +23,6 @@ module Rails
|
|
23
23
|
autoload :NamedBase, "rails/generators/named_base"
|
24
24
|
autoload :ResourceHelpers, "rails/generators/resource_helpers"
|
25
25
|
autoload :TestCase, "rails/generators/test_case"
|
26
|
-
autoload :Devcontainer, "rails/generators/devcontainer"
|
27
26
|
|
28
27
|
mattr_accessor :namespace
|
29
28
|
|
@@ -61,6 +60,10 @@ module Rails
|
|
61
60
|
}
|
62
61
|
}
|
63
62
|
|
63
|
+
# We need to store the RAILS_DEV_PATH in a constant, otherwise the path
|
64
|
+
# can change when we FileUtils.cd.
|
65
|
+
RAILS_DEV_PATH = File.expand_path("../../..", __dir__) # :nodoc:
|
66
|
+
|
64
67
|
class << self
|
65
68
|
def configure!(config) # :nodoc:
|
66
69
|
api_only! if config.api_only
|
@@ -152,7 +155,8 @@ module Rails
|
|
152
155
|
"#{template}:scaffold",
|
153
156
|
"#{template}:mailer",
|
154
157
|
"action_text:install",
|
155
|
-
"action_mailbox:install"
|
158
|
+
"action_mailbox:install",
|
159
|
+
"devcontainer"
|
156
160
|
]
|
157
161
|
end
|
158
162
|
end
|
@@ -7,6 +7,8 @@ class Rails::InfoController < Rails::ApplicationController # :nodoc:
|
|
7
7
|
prepend_view_path ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS
|
8
8
|
layout -> { request.xhr? ? false : "application" }
|
9
9
|
|
10
|
+
RFC2396_PARSER = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::RFC2396_Parser.new
|
11
|
+
|
10
12
|
before_action :require_local!
|
11
13
|
|
12
14
|
def index
|
@@ -20,7 +22,7 @@ class Rails::InfoController < Rails::ApplicationController # :nodoc:
|
|
20
22
|
|
21
23
|
def routes
|
22
24
|
if query = params[:query]
|
23
|
-
query =
|
25
|
+
query = RFC2396_PARSER.escape query
|
24
26
|
|
25
27
|
render json: {
|
26
28
|
exact: matching_routes(query: query, exact_match: true),
|
@@ -53,7 +55,7 @@ class Rails::InfoController < Rails::ApplicationController # :nodoc:
|
|
53
55
|
match ||= (query === route_wrapper.verb)
|
54
56
|
|
55
57
|
unless match
|
56
|
-
controller_action =
|
58
|
+
controller_action = RFC2396_PARSER.escape(route_wrapper.reqs)
|
57
59
|
match = exact_match ? (query === controller_action) : controller_action.include?(query)
|
58
60
|
end
|
59
61
|
|
data/lib/rails/railtie.rb
CHANGED
@@ -50,8 +50,8 @@ module Rails
|
|
50
50
|
# To add an initialization step to the \Rails boot process from your railtie, just
|
51
51
|
# define the initialization code with the +initializer+ macro:
|
52
52
|
#
|
53
|
-
# class
|
54
|
-
# initializer "
|
53
|
+
# class MyGem::Railtie < Rails::Railtie
|
54
|
+
# initializer "my_gem.configure_rails_initialization" do
|
55
55
|
# # some initialization behavior
|
56
56
|
# end
|
57
57
|
# end
|
@@ -59,9 +59,9 @@ module Rails
|
|
59
59
|
# If specified, the block can also receive the application object, in case you
|
60
60
|
# need to access some application-specific configuration, like middleware:
|
61
61
|
#
|
62
|
-
# class
|
63
|
-
# initializer "
|
64
|
-
# app.middleware.use
|
62
|
+
# class MyGem::Railtie < Rails::Railtie
|
63
|
+
# initializer "my_gem.configure_rails_initialization" do |app|
|
64
|
+
# app.middleware.use MyGem::Middleware
|
65
65
|
# end
|
66
66
|
# end
|
67
67
|
#
|
@@ -74,14 +74,14 @@ module Rails
|
|
74
74
|
# Railties can access a config object which contains configuration shared by all
|
75
75
|
# railties and the application:
|
76
76
|
#
|
77
|
-
# class
|
77
|
+
# class MyGem::Railtie < Rails::Railtie
|
78
78
|
# # Customize the ORM
|
79
|
-
# config.app_generators.orm :
|
79
|
+
# config.app_generators.orm :my_gem_orm
|
80
80
|
#
|
81
81
|
# # Add a to_prepare block which is executed once in production
|
82
82
|
# # and before each request in development.
|
83
83
|
# config.to_prepare do
|
84
|
-
#
|
84
|
+
# MyGem.setup!
|
85
85
|
# end
|
86
86
|
# end
|
87
87
|
#
|
@@ -90,9 +90,9 @@ module Rails
|
|
90
90
|
# If your railtie has Rake tasks, you can tell \Rails to load them through the method
|
91
91
|
# +rake_tasks+:
|
92
92
|
#
|
93
|
-
# class
|
93
|
+
# class MyGem::Railtie < Rails::Railtie
|
94
94
|
# rake_tasks do
|
95
|
-
# load "path/to/
|
95
|
+
# load "path/to/my_gem.tasks"
|
96
96
|
# end
|
97
97
|
# end
|
98
98
|
#
|
@@ -100,9 +100,9 @@ module Rails
|
|
100
100
|
# your generators at a different location, you can specify in your railtie a block which
|
101
101
|
# will load them during normal generators lookup:
|
102
102
|
#
|
103
|
-
# class
|
103
|
+
# class MyGem::Railtie < Rails::Railtie
|
104
104
|
# generators do
|
105
|
-
# require "path/to/
|
105
|
+
# require "path/to/my_gem_generator"
|
106
106
|
# end
|
107
107
|
# end
|
108
108
|
#
|
@@ -120,7 +120,7 @@ module Rails
|
|
120
120
|
# this less confusing for everyone.
|
121
121
|
# It can be used like this:
|
122
122
|
#
|
123
|
-
# class
|
123
|
+
# class MyGem::Railtie < Rails::Railtie
|
124
124
|
# server do
|
125
125
|
# WebpackServer.start
|
126
126
|
# end
|
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: 7.2.
|
4
|
+
version: 7.2.2
|
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-
|
11
|
+
date: 2024-10-31 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: 7.2.
|
19
|
+
version: 7.2.2
|
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: 7.2.
|
26
|
+
version: 7.2.2
|
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: 7.2.
|
33
|
+
version: 7.2.2
|
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: 7.2.
|
40
|
+
version: 7.2.2
|
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: 7.2.
|
123
|
+
version: 7.2.2
|
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: 7.2.
|
130
|
+
version: 7.2.2
|
131
131
|
description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
|
132
132
|
email: david@loudthinking.com
|
133
133
|
executables:
|
@@ -469,10 +469,10 @@ licenses:
|
|
469
469
|
- MIT
|
470
470
|
metadata:
|
471
471
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
472
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.2.
|
473
|
-
documentation_uri: https://api.rubyonrails.org/v7.2.
|
472
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.2.2/railties/CHANGELOG.md
|
473
|
+
documentation_uri: https://api.rubyonrails.org/v7.2.2/
|
474
474
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
475
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.2.
|
475
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.2.2/railties
|
476
476
|
rubygems_mfa_required: 'true'
|
477
477
|
post_install_message:
|
478
478
|
rdoc_options:
|