railties 7.2.0 → 7.2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfbc258d03c709473511d240ffab0b5bbb1b0f439158c768c113054dea8d296a
4
- data.tar.gz: 9640e2920bd9ada2cec2f8d684ddcb40f778be9a44dba03be29b5db3fb820b97
3
+ metadata.gz: 31050a1b77f664727c56e1125ff24bf3b0e86e91e530ee862c0f76856002fd11
4
+ data.tar.gz: 7336a7ad6f117ebc14d485d1eb802da1367ea707c25560aece81894430c12a2d
5
5
  SHA512:
6
- metadata.gz: 8ab08f5e3bb2fc56427effe82fc71728e4fc0294ac20b74eaebc518a8acf90eed0efab83744a323ea8c5587952097f164b38ffc1d8c95cc6a0e9903f306608f9
7
- data.tar.gz: 873c2117ffa487d4d82c956e02935180277dbf9157476e207a2f6f1f92f650f2c534ed956b3437e580e22b32ad4bb7b58fcdd39725cf6f66f2e0512bba2215d9
6
+ metadata.gz: 71d3dfd8231f263ab81fe5996f275719aae84c8f17df6bdada1e184ad4c259a0459647a1f5b29331bc0af39c29dfa28bc7adeab32cf317688ef6d6dc5bd4efab
7
+ data.tar.gz: e2863d73e88f3a51b304fe85965472648ee0aa170ea5c88bd77c78abe9735ca8796e26d0e11f74f501c204e26b9d75cf15ab6948f7361269cd1592e6ef75ee55
data/CHANGELOG.md CHANGED
@@ -1,3 +1,56 @@
1
+ ## Rails 7.2.2.1 (December 10, 2024) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 7.2.2 (October 30, 2024) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 7.2.1.2 (October 23, 2024) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 7.2.1.1 (October 15, 2024) ##
17
+
18
+ * No changes.
19
+
20
+
21
+ ## Rails 7.2.1 (August 22, 2024) ##
22
+
23
+ * Fix `rails console` for application with non default application constant.
24
+
25
+ The wrongly assumed the Rails application would be named `AppNamespace::Application`,
26
+ which is the default but not an obligation.
27
+
28
+ *Jean Boussier*
29
+
30
+ * Fix the default Dockerfile to include the full sqlite3 package.
31
+
32
+ Prior to this it only included `libsqlite3`, so it wasn't enough to
33
+ run `rails dbconsole`.
34
+
35
+ *Jerome Dalbert*
36
+
37
+ * Don't update public directory during `app:update` command for API-only Applications.
38
+
39
+ *y-yagi*
40
+
41
+ * Don't add bin/brakeman if brakeman is not in bundle when upgrading an application.
42
+
43
+ *Etienne Barrié*
44
+
45
+ * Remove PWA views and routes if its an API only project.
46
+
47
+ *Jean Boussier*
48
+
49
+ * Simplify generated Puma configuration
50
+
51
+ *DHH*, *Rafael Mendonça França*
52
+
53
+
1
54
  ## Rails 7.2.0 (August 09, 2024) ##
2
55
 
3
56
  * The new `bin/rails boot` command boots the application and exits. Supports the
@@ -134,6 +134,13 @@ module Rails
134
134
  @initialized
135
135
  end
136
136
 
137
+ # Returns the dasherized application name.
138
+ #
139
+ # MyApp::Application.new.name => "my-app"
140
+ def name
141
+ self.class.name.underscore.dasherize.delete_suffix("/application")
142
+ end
143
+
137
144
  def run_load_hooks! # :nodoc:
138
145
  return self if @ran_load_hooks
139
146
  @ran_load_hooks = true
@@ -69,6 +69,8 @@ module Rails
69
69
  skip_action_mailbox: !defined?(ActionMailbox::Engine),
70
70
  skip_action_text: !defined?(ActionText::Engine),
71
71
  skip_action_cable: !defined?(ActionCable::Engine),
72
+ skip_brakeman: skip_gem?("brakeman"),
73
+ skip_rubocop: skip_gem?("rubocop"),
72
74
  skip_test: !defined?(Rails::TestUnitRailtie),
73
75
  skip_system_test: Rails.application.config.generators.system_tests.nil?,
74
76
  asset_pipeline: asset_pipeline,
@@ -87,6 +89,13 @@ module Rails
87
89
  nil
88
90
  end
89
91
  end
92
+
93
+ def skip_gem?(gem_name)
94
+ gem gem_name
95
+ false
96
+ rescue LoadError
97
+ true
98
+ end
90
99
  end
91
100
  end
92
101
  end
@@ -51,7 +51,16 @@ module Rails
51
51
  end
52
52
  end
53
53
 
54
- class Reloader < IRB::Command::Base
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::Command.register(:reload!, Reloader)
79
+ IRB::HelperMethod.register(:reload!, ReloadHelper)
80
+ IRB::Command.register(:reload!, ReloadCommand)
71
81
 
72
82
  class IRBConsole
73
83
  def initialize(app)
@@ -89,9 +99,8 @@ module Rails
89
99
  end
90
100
 
91
101
  env = colorized_env
92
- app_name = @app.class.module_parent_name.underscore.dasherize
93
102
  prompt_prefix = "%N(#{env})"
94
- IRB.conf[:IRB_NAME] = app_name
103
+ IRB.conf[:IRB_NAME] = @app.name
95
104
 
96
105
  IRB.conf[:PROMPT][:RAILS_PROMPT] = {
97
106
  PROMPT_I: "#{prompt_prefix}> ",
data/lib/rails/engine.rb CHANGED
@@ -643,9 +643,9 @@ module Rails
643
643
  end
644
644
  end
645
645
 
646
- initializer :wrap_executor_around_load_seed do |app|
646
+ initializer :wrap_reloader_around_load_seed do |app|
647
647
  self.class.set_callback(:load_seed, :around) do |engine, seeds_block|
648
- app.executor.wrap(&seeds_block)
648
+ app.reloader.wrap(&seeds_block)
649
649
  end
650
650
  end
651
651
 
@@ -9,8 +9,8 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 2
12
- TINY = 0
13
- PRE = nil
12
+ TINY = 2
13
+ PRE = "1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -227,7 +227,7 @@ module Rails
227
227
  end
228
228
 
229
229
  def base_package
230
- "libsqlite3-0"
230
+ "sqlite3"
231
231
  end
232
232
 
233
233
  def build_package
@@ -229,6 +229,8 @@ module Rails
229
229
  end
230
230
 
231
231
  def public_directory
232
+ return if options[:update] && options[:api]
233
+
232
234
  directory "public", "public", recursive: false
233
235
  end
234
236
 
@@ -284,10 +286,6 @@ module Rails
284
286
  end
285
287
 
286
288
  module Generators
287
- # We need to store the RAILS_DEV_PATH in a constant, otherwise the path
288
- # can change in Ruby 1.8.7 when we FileUtils.cd.
289
- RAILS_DEV_PATH = File.expand_path("../../../../../..", __dir__)
290
-
291
289
  class AppGenerator < AppBase
292
290
  # :stopdoc:
293
291
 
@@ -490,6 +488,7 @@ module Rails
490
488
  remove_dir "app/views"
491
489
  else
492
490
  remove_file "app/views/layouts/application.html.erb"
491
+ remove_dir "app/views/pwa"
493
492
  end
494
493
  end
495
494
  end
@@ -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 -%>
@@ -4,7 +4,7 @@
4
4
  // const { title, options } = await event.data.json()
5
5
  // event.waitUntil(self.registration.showNotification(title, options))
6
6
  // })
7
- //
7
+ //
8
8
  // self.addEventListener("notificationclick", function(event) {
9
9
  // event.notification.close()
10
10
  // event.waitUntil(
@@ -12,12 +12,12 @@
12
12
  // for (let i = 0; i < clientList.length; i++) {
13
13
  // let client = clientList[i]
14
14
  // let clientPath = (new URL(client.url)).pathname
15
- //
15
+ //
16
16
  // if (clientPath == event.notification.data.path && "focus" in client) {
17
17
  // return client.focus()
18
18
  // }
19
19
  // }
20
- //
20
+ //
21
21
  // if (clients.openWindow) {
22
22
  // return clients.openWindow(event.notification.data.path)
23
23
  // }
@@ -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.
@@ -10,5 +10,5 @@ Rails.application.config.assets.version = "1.0"
10
10
  # Precompile additional assets.
11
11
  # application.js, application.css, and all non-JS/CSS in the app/assets
12
12
  # folder are already added.
13
- # Rails.application.config.assets.precompile += %w( admin.js admin.css )
13
+ # Rails.application.config.assets.precompile += %w[ admin.js admin.css ]
14
14
  <% end -%>
@@ -29,5 +29,6 @@ port ENV.fetch("PORT", 3000)
29
29
  # Allow puma to be restarted by `bin/rails restart` command.
30
30
  plugin :tmp_restart
31
31
 
32
- # Only use a pidfile when requested
32
+ # Specify the PID file. Defaults to tmp/pids/server.pid in development.
33
+ # In other environments, only set the PID file if requested.
33
34
  pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
@@ -5,10 +5,12 @@ Rails.application.routes.draw do
5
5
  # Can be used by load balancers and uptime monitors to verify that the app is live.
6
6
  get "up" => "rails/health#show", as: :rails_health_check
7
7
 
8
+ <%- unless options.api? -%>
8
9
  # Render dynamic PWA files from app/views/pwa/*
9
10
  get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
10
11
  get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
11
12
 
13
+ <%- end -%>
12
14
  # Defines the root path route ("/")
13
15
  # root "posts#index"
14
16
  end
@@ -24,7 +24,7 @@ jobs:
24
24
  run: bin/brakeman --no-pager
25
25
 
26
26
  <% end -%>
27
- <%- if options[:javascript] == "importmap" -%>
27
+ <%- if options[:javascript] == "importmap" && !options[:api] -%>
28
28
  scan_js:
29
29
  runs-on: ubuntu-latest
30
30
 
@@ -148,7 +148,7 @@ module Rails
148
148
  end
149
149
 
150
150
  def system_test_configuration
151
- optimize_indentation(<<-'RUBY', 2)
151
+ optimize_indentation(<<-'RUBY', 2).chomp
152
152
  if ENV["CAPYBARA_SERVER_PORT"]
153
153
  served_by host: "rails-app", port: ENV["CAPYBARA_SERVER_PORT"]
154
154
 
@@ -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: bin/rails <%= test_command %>
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
@@ -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 = URI::DEFAULT_PARSER.escape 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 = URI::DEFAULT_PARSER.escape(route_wrapper.reqs)
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 MyRailtie < Rails::Railtie
54
- # initializer "my_railtie.configure_rails_initialization" do
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 MyRailtie < Rails::Railtie
63
- # initializer "my_railtie.configure_rails_initialization" do |app|
64
- # app.middleware.use MyRailtie::Middleware
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 MyRailtie < Rails::Railtie
77
+ # class MyGem::Railtie < Rails::Railtie
78
78
  # # Customize the ORM
79
- # config.app_generators.orm :my_railtie_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
- # MyRailtie.setup!
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 MyRailtie < Rails::Railtie
93
+ # class MyGem::Railtie < Rails::Railtie
94
94
  # rake_tasks do
95
- # load "path/to/my_railtie.tasks"
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 MyRailtie < Rails::Railtie
103
+ # class MyGem::Railtie < Rails::Railtie
104
104
  # generators do
105
- # require "path/to/my_railtie_generator"
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 MyRailtie < Rails::Railtie
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.0
4
+ version: 7.2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-09 00:00:00.000000000 Z
11
+ date: 2024-12-10 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.0
19
+ version: 7.2.2.1
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.0
26
+ version: 7.2.2.1
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.0
33
+ version: 7.2.2.1
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.0
40
+ version: 7.2.2.1
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.0
123
+ version: 7.2.2.1
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.0
130
+ version: 7.2.2.1
131
131
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
132
132
  email: david@loudthinking.com
133
133
  executables:
@@ -469,12 +469,12 @@ 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.0/railties/CHANGELOG.md
473
- documentation_uri: https://api.rubyonrails.org/v7.2.0/
472
+ changelog_uri: https://github.com/rails/rails/blob/v7.2.2.1/railties/CHANGELOG.md
473
+ documentation_uri: https://api.rubyonrails.org/v7.2.2.1/
474
474
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
475
- source_code_uri: https://github.com/rails/rails/tree/v7.2.0/railties
475
+ source_code_uri: https://github.com/rails/rails/tree/v7.2.2.1/railties
476
476
  rubygems_mfa_required: 'true'
477
- post_install_message:
477
+ post_install_message:
478
478
  rdoc_options:
479
479
  - "--exclude"
480
480
  - "."
@@ -491,8 +491,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
491
491
  - !ruby/object:Gem::Version
492
492
  version: '0'
493
493
  requirements: []
494
- rubygems_version: 3.5.11
495
- signing_key:
494
+ rubygems_version: 3.5.22
495
+ signing_key:
496
496
  specification_version: 4
497
497
  summary: Tools for creating, working with, and running Rails applications.
498
498
  test_files: []