railties 7.1.0 → 7.2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +203 -650
  3. data/lib/minitest/rails_plugin.rb +5 -2
  4. data/lib/rails/all.rb +1 -3
  5. data/lib/rails/api/task.rb +6 -4
  6. data/lib/rails/application/bootstrap.rb +11 -8
  7. data/lib/rails/application/configuration.rb +80 -36
  8. data/lib/rails/application/dummy_config.rb +2 -2
  9. data/lib/rails/application/finisher.rb +10 -0
  10. data/lib/rails/application.rb +29 -76
  11. data/lib/rails/backtrace_cleaner.rb +18 -3
  12. data/lib/rails/cli.rb +0 -1
  13. data/lib/rails/command.rb +1 -1
  14. data/lib/rails/commands/app/update_command.rb +102 -0
  15. data/lib/rails/commands/boot/boot_command.rb +14 -0
  16. data/lib/rails/commands/console/console_command.rb +2 -21
  17. data/lib/rails/commands/console/irb_console.rb +146 -0
  18. data/lib/rails/commands/credentials/USAGE +1 -1
  19. data/lib/rails/commands/credentials/credentials_command.rb +2 -2
  20. data/lib/rails/commands/dbconsole/dbconsole_command.rb +21 -30
  21. data/lib/rails/commands/devcontainer/devcontainer_command.rb +39 -0
  22. data/lib/rails/commands/rake/rake_command.rb +1 -1
  23. data/lib/rails/commands/runner/runner_command.rb +14 -3
  24. data/lib/rails/commands/server/server_command.rb +5 -3
  25. data/lib/rails/commands/test/test_command.rb +2 -0
  26. data/lib/rails/configuration.rb +10 -1
  27. data/lib/rails/console/app.rb +5 -32
  28. data/lib/rails/console/helpers.rb +5 -16
  29. data/lib/rails/console/methods.rb +23 -0
  30. data/lib/rails/engine/configuration.rb +45 -6
  31. data/lib/rails/engine.rb +24 -17
  32. data/lib/rails/gem_version.rb +3 -3
  33. data/lib/rails/generators/active_model.rb +26 -12
  34. data/lib/rails/generators/app_base.rb +80 -61
  35. data/lib/rails/generators/base.rb +9 -5
  36. data/lib/rails/generators/database.rb +227 -69
  37. data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +2 -0
  38. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +2 -0
  39. data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +2 -0
  40. data/lib/rails/generators/generated_attribute.rb +26 -1
  41. data/lib/rails/generators/migration.rb +3 -3
  42. data/lib/rails/generators/rails/app/app_generator.rb +57 -32
  43. data/lib/rails/generators/rails/app/templates/Dockerfile.tt +23 -16
  44. data/lib/rails/generators/rails/app/templates/Gemfile.tt +17 -17
  45. data/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +4 -0
  46. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +8 -1
  47. data/lib/rails/generators/rails/app/templates/app/views/pwa/manifest.json.erb.tt +22 -0
  48. data/lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js +26 -0
  49. data/lib/rails/generators/rails/app/templates/bin/brakeman.tt +6 -0
  50. data/lib/rails/generators/rails/app/templates/bin/rubocop.tt +7 -0
  51. data/lib/rails/generators/rails/app/templates/bin/setup.tt +6 -2
  52. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +1 -1
  53. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +3 -3
  54. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +11 -4
  55. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +8 -1
  56. data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +3 -3
  57. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +14 -7
  58. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +14 -6
  59. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +10 -7
  60. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -1
  61. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -3
  62. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt +70 -0
  63. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +25 -26
  64. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +6 -0
  65. data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +5 -0
  66. data/lib/rails/generators/rails/app/templates/dockerignore.tt +13 -0
  67. data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +138 -0
  68. data/lib/rails/generators/rails/app/templates/github/dependabot.yml +12 -0
  69. data/lib/rails/generators/rails/app/templates/gitignore.tt +3 -3
  70. data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +66 -0
  71. data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
  72. data/lib/rails/generators/rails/app/templates/public/icon.svg +3 -0
  73. data/lib/rails/generators/rails/app/templates/rubocop.yml.tt +8 -0
  74. data/lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt +1 -1
  75. data/lib/rails/generators/rails/controller/controller_generator.rb +1 -1
  76. data/lib/rails/generators/rails/db/system/change/change_generator.rb +134 -20
  77. data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +166 -0
  78. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt +3 -0
  79. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/compose.yaml.tt +47 -0
  80. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +37 -0
  81. data/lib/rails/generators/rails/migration/migration_generator.rb +4 -0
  82. data/lib/rails/generators/rails/plugin/plugin_generator.rb +40 -7
  83. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +2 -2
  84. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +5 -1
  85. data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +2 -0
  86. data/lib/rails/generators/rails/plugin/templates/bin/rubocop.tt +7 -0
  87. data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +103 -0
  88. data/lib/rails/generators/rails/plugin/templates/github/dependabot.yml +12 -0
  89. data/lib/rails/generators/rails/plugin/templates/rubocop.yml.tt +8 -0
  90. data/lib/rails/generators/rails/plugin/templates/test/application_system_test_case.rb.tt +1 -1
  91. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +2 -2
  92. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +6 -4
  93. data/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt +3 -2
  94. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +15 -1
  95. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +2 -2
  96. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +2 -2
  97. data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +2 -0
  98. data/lib/rails/generators/test_unit/system/templates/application_system_test_case.rb.tt +1 -1
  99. data/lib/rails/generators/testing/assertions.rb +20 -0
  100. data/lib/rails/generators/testing/behavior.rb +7 -6
  101. data/lib/rails/generators.rb +7 -3
  102. data/lib/rails/health_controller.rb +2 -2
  103. data/lib/rails/info.rb +2 -2
  104. data/lib/rails/info_controller.rb +4 -2
  105. data/lib/rails/mailers_controller.rb +14 -1
  106. data/lib/rails/paths.rb +2 -2
  107. data/lib/rails/pwa_controller.rb +15 -0
  108. data/lib/rails/rack/logger.rb +15 -7
  109. data/lib/rails/railtie/configurable.rb +2 -2
  110. data/lib/rails/railtie.rb +15 -16
  111. data/lib/rails/tasks/framework.rake +0 -26
  112. data/lib/rails/tasks/tmp.rake +1 -1
  113. data/lib/rails/tasks/zeitwerk.rake +14 -34
  114. data/lib/rails/templates/layouts/application.html.erb +1 -1
  115. data/lib/rails/templates/rails/mailers/email.html.erb +20 -9
  116. data/lib/rails/templates/rails/welcome/index.html.erb +4 -2
  117. data/lib/rails/test_help.rb +2 -4
  118. data/lib/rails/test_unit/reporter.rb +8 -2
  119. data/lib/rails/test_unit/runner.rb +26 -2
  120. data/lib/rails/test_unit/test_parser.rb +45 -0
  121. data/lib/rails/testing/maintain_test_schema.rb +1 -1
  122. data/lib/rails/zeitwerk_checker.rb +15 -0
  123. data/lib/rails.rb +7 -4
  124. metadata +46 -35
  125. data/lib/rails/app_updater.rb +0 -40
  126. data/lib/rails/commands/secrets/USAGE +0 -61
  127. data/lib/rails/commands/secrets/secrets_command.rb +0 -46
  128. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +0 -68
  129. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +0 -54
  130. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +0 -70
  131. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +0 -24
  132. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +0 -62
  133. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +0 -53
  134. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt +0 -223
  135. data/lib/rails/generators/rails/app/templates/public/apple-touch-icon-precomposed.png +0 -0
  136. data/lib/rails/generators/rails/app/templates/public/apple-touch-icon.png +0 -0
  137. data/lib/rails/generators/rails/app/templates/public/favicon.ico +0 -0
  138. data/lib/rails/ruby_version_check.rb +0 -17
  139. data/lib/rails/secrets.rb +0 -110
@@ -7,19 +7,17 @@
7
7
  abort("Abort testing: Your Rails environment is running in production mode!") if Rails.env.production?
8
8
 
9
9
  require "active_support/test_case"
10
- require "action_controller"
11
- require "action_controller/test_case"
12
- require "action_dispatch/testing/integration"
13
10
  require "rails/generators/test_case"
14
-
15
11
  require "active_support/testing/autorun"
16
12
 
17
13
  require "rails/testing/maintain_test_schema"
18
14
 
19
15
  if defined?(ActiveRecord::Base)
16
+ require "active_record/testing/query_assertions"
20
17
  ActiveSupport.on_load(:active_support_test_case) do
21
18
  include ActiveRecord::TestDatabases
22
19
  include ActiveRecord::TestFixtures
20
+ include ActiveRecord::Assertions::QueryAssertions
23
21
 
24
22
  self.fixture_paths << "#{Rails.root}/test/fixtures/"
25
23
  self.file_fixture_path = "#{Rails.root}/test/fixtures/files"
@@ -8,6 +8,13 @@ module Rails
8
8
  class_attribute :app_root
9
9
  class_attribute :executable, default: "bin/rails test"
10
10
 
11
+ def prerecord(test_class, test_name)
12
+ super
13
+ if options[:verbose]
14
+ io.print "%s#%s = " % [test_class.name, test_name]
15
+ end
16
+ end
17
+
11
18
  def record(result)
12
19
  super
13
20
 
@@ -69,8 +76,7 @@ module Rails
69
76
  end
70
77
 
71
78
  def format_line(result)
72
- klass = result.respond_to?(:klass) ? result.klass : result.class
73
- "%s#%s = %.2f s = %s" % [klass, result.name, result.time, result.result_code]
79
+ "%.2f s = %s" % [result.time, result.result_code]
74
80
  end
75
81
 
76
82
  def format_rerun_snippet(result)
@@ -9,6 +9,15 @@ require "rails/test_unit/test_parser"
9
9
 
10
10
  module Rails
11
11
  module TestUnit
12
+ class InvalidTestError < StandardError
13
+ def initialize(path, suggestion)
14
+ super(<<~MESSAGE.squish)
15
+ Could not load test file: #{path}.
16
+ #{suggestion}
17
+ MESSAGE
18
+ end
19
+ end
20
+
12
21
  class Runner
13
22
  TEST_FOLDERS = [:models, :helpers, :channels, :controllers, :mailers, :integration, :jobs, :mailboxes]
14
23
  PATH_ARGUMENT_PATTERN = %r"^(?!/.+/$)[.\w]*[/\\]"
@@ -48,7 +57,22 @@ module Rails
48
57
  def load_tests(argv)
49
58
  patterns = extract_filters(argv)
50
59
  tests = list_tests(patterns)
51
- tests.to_a.each { |path| require File.expand_path(path) }
60
+ tests.to_a.each do |path|
61
+ abs_path = File.expand_path(path)
62
+ require abs_path
63
+ rescue LoadError => exception
64
+ if exception.path == abs_path
65
+ all_tests = list_tests([default_test_glob])
66
+ corrections = DidYouMean::SpellChecker.new(dictionary: all_tests).correct(path)
67
+
68
+ if corrections.empty?
69
+ raise exception
70
+ end
71
+ raise InvalidTestError.new(path, DidYouMean::Formatter.message_for(corrections))
72
+ else
73
+ raise
74
+ end
75
+ end
52
76
  end
53
77
 
54
78
  def compose_filter(runnable, filter)
@@ -87,7 +111,7 @@ module Rails
87
111
  end
88
112
 
89
113
  def default_test_exclude_glob
90
- ENV["DEFAULT_TEST_EXCLUDE"] || "test/{system,dummy}/**/*_test.rb"
114
+ ENV["DEFAULT_TEST_EXCLUDE"] || "test/{system,dummy,fixtures}/**/*_test.rb"
91
115
  end
92
116
 
93
117
  def regexp_filter?(arg)
@@ -1,5 +1,50 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ begin
4
+ require "prism"
5
+ rescue LoadError
6
+ # If Prism isn't available (because of using an older Ruby version) then we'll
7
+ # define a fallback parser using ripper.
8
+ end
9
+
10
+ if defined?(Prism)
11
+ module Rails
12
+ module TestUnit
13
+ # Parse a test file to extract the line ranges of all tests in both
14
+ # method-style (def test_foo) and declarative-style (test "foo" do)
15
+ module TestParser
16
+ # Helper to translate a method object into the path and line range where
17
+ # the method was defined.
18
+ def self.definition_for(method)
19
+ filepath, start_line = method.source_location
20
+ queue = [Prism.parse_file(filepath).value]
21
+
22
+ while (node = queue.shift)
23
+ case node.type
24
+ when :def_node
25
+ if node.location.start_line == start_line
26
+ return [filepath, start_line..node.location.end_line]
27
+ end
28
+ when :call_node
29
+ if node.location.start_line == start_line
30
+ return [filepath, start_line..node.location.end_line]
31
+ end
32
+ end
33
+
34
+ queue.concat(node.compact_child_nodes)
35
+ end
36
+
37
+ nil
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ # If we have Prism, then we don't need to define the fallback parser using
44
+ # ripper.
45
+ return
46
+ end
47
+
3
48
  require "ripper"
4
49
 
5
50
  module Rails
@@ -10,7 +10,7 @@ if defined?(ActiveRecord::Base)
10
10
 
11
11
  if Rails.configuration.eager_load
12
12
  ActiveRecord::Base.descendants.each do |model|
13
- model.load_schema unless model.abstract_class?
13
+ model.load_schema if !model.abstract_class? && model.table_exists?
14
14
  end
15
15
  end
16
16
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The actual (private) implementation of the Rake task zeitwerk:check.
4
+ class Rails::ZeitwerkChecker # :nodoc:
5
+ def self.check
6
+ Zeitwerk::Loader.eager_load_all
7
+
8
+ autoloaded = ActiveSupport::Dependencies.autoload_paths + ActiveSupport::Dependencies.autoload_once_paths
9
+ eager_loaded = ActiveSupport::Dependencies._eager_load_paths.to_a
10
+
11
+ unchecked = autoloaded - eager_loaded
12
+ unchecked.select! { |dir| Dir.exist?(dir) && !Dir.empty?(dir) }
13
+ unchecked
14
+ end
15
+ end
data/lib/rails.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rails/ruby_version_check"
4
-
5
3
  require "pathname"
6
4
 
7
5
  require "active_support"
@@ -24,17 +22,21 @@ silence_warnings do
24
22
  Encoding.default_internal = Encoding::UTF_8
25
23
  end
26
24
 
27
- # :include: railties/README.rdoc
25
+ # :include: ../README.rdoc
28
26
  module Rails
29
27
  extend ActiveSupport::Autoload
30
28
  extend ActiveSupport::Benchmarkable
31
29
 
32
- autoload :HealthController
33
30
  autoload :Info
34
31
  autoload :InfoController
35
32
  autoload :MailersController
36
33
  autoload :WelcomeController
37
34
 
35
+ eager_autoload do
36
+ autoload :HealthController
37
+ autoload :PwaController
38
+ end
39
+
38
40
  class << self
39
41
  @application = @app_class = nil
40
42
 
@@ -69,6 +71,7 @@ module Rails
69
71
  # Rails.env # => "development"
70
72
  # Rails.env.development? # => true
71
73
  # Rails.env.production? # => false
74
+ # Rails.env.local? # => true true for "development" and "test", false for anything else
72
75
  def env
73
76
  @_env ||= ActiveSupport::EnvironmentInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development")
74
77
  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.1.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: 2023-10-05 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.1.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.1.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.1.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.1.0
40
+ version: 7.2.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rackup
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -104,30 +104,30 @@ dependencies:
104
104
  name: irb
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
107
+ - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '0'
109
+ version: '1.13'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ">="
114
+ - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '0'
116
+ version: '1.13'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: actionview
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 7.1.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.1.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:
@@ -146,7 +146,6 @@ files:
146
146
  - lib/rails/api/generator.rb
147
147
  - lib/rails/api/task.rb
148
148
  - lib/rails/app_loader.rb
149
- - lib/rails/app_updater.rb
150
149
  - lib/rails/application.rb
151
150
  - lib/rails/application/bootstrap.rb
152
151
  - lib/rails/application/configuration.rb
@@ -169,8 +168,11 @@ files:
169
168
  - lib/rails/command/helpers/editor.rb
170
169
  - lib/rails/commands.rb
171
170
  - lib/rails/commands/about/about_command.rb
171
+ - lib/rails/commands/app/update_command.rb
172
172
  - lib/rails/commands/application/application_command.rb
173
+ - lib/rails/commands/boot/boot_command.rb
173
174
  - lib/rails/commands/console/console_command.rb
175
+ - lib/rails/commands/console/irb_console.rb
174
176
  - lib/rails/commands/credentials/USAGE
175
177
  - lib/rails/commands/credentials/credentials_command.rb
176
178
  - lib/rails/commands/credentials/credentials_command/diffing.rb
@@ -178,6 +180,7 @@ files:
178
180
  - lib/rails/commands/dbconsole/dbconsole_command.rb
179
181
  - lib/rails/commands/destroy/destroy_command.rb
180
182
  - lib/rails/commands/dev/dev_command.rb
183
+ - lib/rails/commands/devcontainer/devcontainer_command.rb
181
184
  - lib/rails/commands/encrypted/USAGE
182
185
  - lib/rails/commands/encrypted/encrypted_command.rb
183
186
  - lib/rails/commands/gem_help/USAGE
@@ -196,8 +199,6 @@ files:
196
199
  - lib/rails/commands/runner/USAGE
197
200
  - lib/rails/commands/runner/runner_command.rb
198
201
  - lib/rails/commands/secret/secret_command.rb
199
- - lib/rails/commands/secrets/USAGE
200
- - lib/rails/commands/secrets/secrets_command.rb
201
202
  - lib/rails/commands/server/server_command.rb
202
203
  - lib/rails/commands/test/USAGE
203
204
  - lib/rails/commands/test/test_command.rb
@@ -206,6 +207,7 @@ files:
206
207
  - lib/rails/configuration.rb
207
208
  - lib/rails/console/app.rb
208
209
  - lib/rails/console/helpers.rb
210
+ - lib/rails/console/methods.rb
209
211
  - lib/rails/deprecator.rb
210
212
  - lib/rails/dev_caching.rb
211
213
  - lib/rails/engine.rb
@@ -259,22 +261,20 @@ files:
259
261
  - lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt
260
262
  - lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt
261
263
  - lib/rails/generators/rails/app/templates/app/views/layouts/mailer.text.erb.tt
264
+ - lib/rails/generators/rails/app/templates/app/views/pwa/manifest.json.erb.tt
265
+ - lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js
266
+ - lib/rails/generators/rails/app/templates/bin/brakeman.tt
262
267
  - lib/rails/generators/rails/app/templates/bin/rails.tt
263
268
  - lib/rails/generators/rails/app/templates/bin/rake.tt
269
+ - lib/rails/generators/rails/app/templates/bin/rubocop.tt
264
270
  - lib/rails/generators/rails/app/templates/bin/setup.tt
265
271
  - lib/rails/generators/rails/app/templates/config.ru.tt
266
272
  - lib/rails/generators/rails/app/templates/config/application.rb.tt
267
273
  - lib/rails/generators/rails/app/templates/config/boot.rb.tt
268
274
  - lib/rails/generators/rails/app/templates/config/cable.yml.tt
269
- - lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt
270
- - lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt
271
- - lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt
272
- - lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt
273
275
  - lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt
274
- - lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt
275
276
  - lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt
276
277
  - lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt
277
- - lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt
278
278
  - lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt
279
279
  - lib/rails/generators/rails/app/templates/config/environment.rb.tt
280
280
  - lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
@@ -285,7 +285,7 @@ files:
285
285
  - lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt
286
286
  - lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt
287
287
  - lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt
288
- - lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt
288
+ - lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt
289
289
  - lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt
290
290
  - lib/rails/generators/rails/app/templates/config/locales/en.yml
291
291
  - lib/rails/generators/rails/app/templates/config/puma.rb.tt
@@ -295,15 +295,18 @@ files:
295
295
  - lib/rails/generators/rails/app/templates/docker-entrypoint.tt
296
296
  - lib/rails/generators/rails/app/templates/dockerignore.tt
297
297
  - lib/rails/generators/rails/app/templates/gitattributes.tt
298
+ - lib/rails/generators/rails/app/templates/github/ci.yml.tt
299
+ - lib/rails/generators/rails/app/templates/github/dependabot.yml
298
300
  - lib/rails/generators/rails/app/templates/gitignore.tt
299
301
  - lib/rails/generators/rails/app/templates/node-version.tt
300
302
  - lib/rails/generators/rails/app/templates/public/404.html
303
+ - lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html
301
304
  - lib/rails/generators/rails/app/templates/public/422.html
302
305
  - lib/rails/generators/rails/app/templates/public/500.html
303
- - lib/rails/generators/rails/app/templates/public/apple-touch-icon-precomposed.png
304
- - lib/rails/generators/rails/app/templates/public/apple-touch-icon.png
305
- - lib/rails/generators/rails/app/templates/public/favicon.ico
306
+ - lib/rails/generators/rails/app/templates/public/icon.png
307
+ - lib/rails/generators/rails/app/templates/public/icon.svg
306
308
  - lib/rails/generators/rails/app/templates/public/robots.txt
309
+ - lib/rails/generators/rails/app/templates/rubocop.yml.tt
307
310
  - lib/rails/generators/rails/app/templates/ruby-version.tt
308
311
  - lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt
309
312
  - lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt
@@ -318,6 +321,10 @@ files:
318
321
  - lib/rails/generators/rails/credentials/credentials_generator.rb
319
322
  - lib/rails/generators/rails/credentials/templates/credentials.yml.tt
320
323
  - lib/rails/generators/rails/db/system/change/change_generator.rb
324
+ - lib/rails/generators/rails/devcontainer/devcontainer_generator.rb
325
+ - lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt
326
+ - lib/rails/generators/rails/devcontainer/templates/devcontainer/compose.yaml.tt
327
+ - lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt
321
328
  - lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb
322
329
  - lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb
323
330
  - lib/rails/generators/rails/generator/USAGE
@@ -348,8 +355,11 @@ files:
348
355
  - lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt
349
356
  - lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt
350
357
  - lib/rails/generators/rails/plugin/templates/bin/rails.tt
358
+ - lib/rails/generators/rails/plugin/templates/bin/rubocop.tt
351
359
  - lib/rails/generators/rails/plugin/templates/bin/test.tt
352
360
  - lib/rails/generators/rails/plugin/templates/config/routes.rb.tt
361
+ - lib/rails/generators/rails/plugin/templates/github/ci.yml.tt
362
+ - lib/rails/generators/rails/plugin/templates/github/dependabot.yml
353
363
  - lib/rails/generators/rails/plugin/templates/gitignore.tt
354
364
  - lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt
355
365
  - lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt
@@ -362,6 +372,7 @@ files:
362
372
  - lib/rails/generators/rails/plugin/templates/rails/javascripts.js.tt
363
373
  - lib/rails/generators/rails/plugin/templates/rails/routes.rb.tt
364
374
  - lib/rails/generators/rails/plugin/templates/rails/stylesheets.css
375
+ - lib/rails/generators/rails/plugin/templates/rubocop.yml.tt
365
376
  - lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt
366
377
  - lib/rails/generators/rails/plugin/templates/test/application_system_test_case.rb.tt
367
378
  - lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt
@@ -418,14 +429,13 @@ files:
418
429
  - lib/rails/mailers_controller.rb
419
430
  - lib/rails/paths.rb
420
431
  - lib/rails/plugin/test.rb
432
+ - lib/rails/pwa_controller.rb
421
433
  - lib/rails/rack.rb
422
434
  - lib/rails/rack/logger.rb
423
435
  - lib/rails/rackup/server.rb
424
436
  - lib/rails/railtie.rb
425
437
  - lib/rails/railtie/configurable.rb
426
438
  - lib/rails/railtie/configuration.rb
427
- - lib/rails/ruby_version_check.rb
428
- - lib/rails/secrets.rb
429
439
  - lib/rails/source_annotation_extractor.rb
430
440
  - lib/rails/tasks.rb
431
441
  - lib/rails/tasks/engine.rake
@@ -453,17 +463,18 @@ files:
453
463
  - lib/rails/testing/maintain_test_schema.rb
454
464
  - lib/rails/version.rb
455
465
  - lib/rails/welcome_controller.rb
466
+ - lib/rails/zeitwerk_checker.rb
456
467
  homepage: https://rubyonrails.org
457
468
  licenses:
458
469
  - MIT
459
470
  metadata:
460
471
  bug_tracker_uri: https://github.com/rails/rails/issues
461
- changelog_uri: https://github.com/rails/rails/blob/v7.1.0/railties/CHANGELOG.md
462
- documentation_uri: https://api.rubyonrails.org/v7.1.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/
463
474
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
464
- source_code_uri: https://github.com/rails/rails/tree/v7.1.0/railties
475
+ source_code_uri: https://github.com/rails/rails/tree/v7.2.2.1/railties
465
476
  rubygems_mfa_required: 'true'
466
- post_install_message:
477
+ post_install_message:
467
478
  rdoc_options:
468
479
  - "--exclude"
469
480
  - "."
@@ -473,15 +484,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
473
484
  requirements:
474
485
  - - ">="
475
486
  - !ruby/object:Gem::Version
476
- version: 2.7.0
487
+ version: 3.1.0
477
488
  required_rubygems_version: !ruby/object:Gem::Requirement
478
489
  requirements:
479
490
  - - ">="
480
491
  - !ruby/object:Gem::Version
481
492
  version: '0'
482
493
  requirements: []
483
- rubygems_version: 3.4.18
484
- signing_key:
494
+ rubygems_version: 3.5.22
495
+ signing_key:
485
496
  specification_version: 4
486
497
  summary: Tools for creating, working with, and running Rails applications.
487
498
  test_files: []
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails/generators"
4
- require "rails/generators/rails/app/app_generator"
5
-
6
- module Rails
7
- class AppUpdater # :nodoc:
8
- class << self
9
- def invoke_from_app_generator(method)
10
- app_generator.send(method)
11
- end
12
-
13
- def app_generator
14
- @app_generator ||= begin
15
- gen = Rails::Generators::AppGenerator.new ["rails"], generator_options, destination_root: Rails.root
16
- gen.send(:valid_const?) unless File.exist?(Rails.root.join("config", "application.rb"))
17
- gen
18
- end
19
- end
20
-
21
- private
22
- def generator_options
23
- options = { api: !!Rails.application.config.api_only, update: true }
24
- options[:name] = Rails.application.class.name.chomp("::Application").underscore
25
- options[:skip_active_job] = !defined?(ActiveJob::Railtie)
26
- options[:skip_active_record] = !defined?(ActiveRecord::Railtie)
27
- options[:skip_active_storage] = !defined?(ActiveStorage::Engine)
28
- options[:skip_action_mailer] = !defined?(ActionMailer::Railtie)
29
- options[:skip_action_mailbox] = !defined?(ActionMailbox::Engine)
30
- options[:skip_action_text] = !defined?(ActionText::Engine)
31
- options[:skip_action_cable] = !defined?(ActionCable::Engine)
32
- options[:skip_test] = !defined?(Rails::TestUnitRailtie)
33
- options[:skip_system_test] = Rails.application.config.generators.system_tests.nil?
34
- options[:skip_asset_pipeline] = !defined?(Sprockets::Railtie) && !defined?(Propshaft::Railtie)
35
- options[:skip_bootsnap] = !defined?(Bootsnap)
36
- options
37
- end
38
- end
39
- end
40
- end
@@ -1,61 +0,0 @@
1
- Description:
2
- ** DEPRECATED **
3
- Rails 5.2 has introduced a new `credentials` API that replaces Rails secrets.
4
- Please use the Rails `credentials` commands instead.
5
- Run `bin/rails credentials:help` for more information.
6
-
7
- The Rails `secrets` commands helps encrypting secrets to slim a production
8
- environment's `ENV` hash. It's also useful for atomic deploys: no need to
9
- coordinate key changes to get everything working as the keys are shipped
10
- with the code.
11
-
12
- Setup:
13
- Run `<%= executable(:setup) %>` to opt in and generate the `config/secrets.yml.key`
14
- and `config/secrets.yml.enc` files.
15
-
16
- The latter contains all the keys to be encrypted while the former holds the
17
- encryption key.
18
-
19
- Don't lose the key! Put it in a password manager your team can access.
20
- Should you lose it no one, including you, will be able to access any encrypted
21
- secrets.
22
- Don't commit the key! Add `config/secrets.yml.key` to your source control's
23
- ignore file. If you use Git, Rails handles this for you.
24
-
25
- Rails also looks for the key in `ENV["RAILS_MASTER_KEY"]` if that's easier to
26
- manage.
27
-
28
- You could prepend that to your server's start command like this:
29
-
30
- RAILS_MASTER_KEY="im-the-master-now-hahaha" server.start
31
-
32
- The `config/secrets.yml.enc` has much the same format as `config/secrets.yml`:
33
-
34
- production:
35
- secret_key_base: so-secret-very-hidden-wow
36
- payment_processing_gateway_key: much-safe-very-gaedwey-wow
37
-
38
- But that's where the similarities between `secrets.yml` and `secrets.yml.enc`
39
- end, e.g. no keys from `secrets.yml` will be moved to `secrets.yml.enc` and
40
- be encrypted.
41
-
42
- A `shared:` top level key is also supported such that any keys there is merged
43
- into the other environments.
44
-
45
- Additionally, Rails won't read encrypted secrets out of the box even if you have
46
- the key. Add this:
47
-
48
- config.read_encrypted_secrets = true
49
-
50
- to the environment you'd like to read encrypted secrets. `<%= executable(:setup) %>`
51
- inserts this into the production environment by default.
52
-
53
- Editing Secrets:
54
- After `<%= executable(:setup) %>`, run `<%= executable(:edit) %>`.
55
-
56
- That command opens a temporary file in `$VISUAL` or `$EDITOR` with the decrypted
57
- contents of `config/secrets.yml.enc` to edit the encrypted secrets.
58
-
59
- When the temporary file is next saved the contents are encrypted and written to
60
- `config/secrets.yml.enc` while the file itself is destroyed to prevent secrets
61
- from leaking.
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_support"
4
- require "rails/secrets"
5
- require "rails/command/helpers/editor"
6
-
7
- module Rails
8
- module Command
9
- class SecretsCommand < Rails::Command::Base # :nodoc:
10
- include Helpers::Editor
11
-
12
- desc "edit", "**deprecated** Open the secrets in `$VISUAL` or `$EDITOR` for editing"
13
- def edit
14
- Rails.deprecator.warn(<<~MSG.squish)
15
- `bin/rails secrets:edit` is deprecated in favor of credentials and will be removed in Rails 7.2.
16
- Run `bin/rails credentials:help` for more information.
17
- MSG
18
-
19
- boot_application!
20
-
21
- using_system_editor do
22
- Rails::Secrets.read_for_editing { |tmp_path| system_editor(tmp_path) }
23
- say "File encrypted and saved."
24
- end
25
- rescue Rails::Secrets::MissingKeyError => error
26
- say error.message
27
- rescue Errno::ENOENT => error
28
- if error.message.include?("secrets.yml.enc")
29
- exit 1
30
- else
31
- raise
32
- end
33
- end
34
-
35
- desc "show", "**deprecated** Show the decrypted secrets"
36
- def show
37
- Rails.deprecator.warn(<<~MSG.squish)
38
- `bin/rails secrets:show` is deprecated in favor of credentials and will be removed in Rails 7.2.
39
- Run `bin/rails credentials:help` for more information.
40
- MSG
41
-
42
- say Rails::Secrets.read
43
- end
44
- end
45
- end
46
- end