railties 6.1.7.8 → 7.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +89 -463
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +16 -16
  5. data/README.rdoc +0 -1
  6. data/lib/rails/app_updater.rb +2 -4
  7. data/lib/rails/application/bootstrap.rb +17 -5
  8. data/lib/rails/application/configuration.rb +52 -31
  9. data/lib/rails/application/default_middleware_stack.rb +6 -3
  10. data/lib/rails/application/finisher.rb +43 -85
  11. data/lib/rails/application/routes_reloader.rb +8 -0
  12. data/lib/rails/application.rb +24 -50
  13. data/lib/rails/application_controller.rb +2 -2
  14. data/lib/rails/autoloaders/inflector.rb +21 -0
  15. data/lib/rails/autoloaders.rb +12 -16
  16. data/lib/rails/code_statistics.rb +2 -2
  17. data/lib/rails/code_statistics_calculator.rb +10 -1
  18. data/lib/rails/command/base.rb +26 -12
  19. data/lib/rails/command/behavior.rb +1 -1
  20. data/lib/rails/command/environment_argument.rb +1 -1
  21. data/lib/rails/command.rb +8 -5
  22. data/lib/rails/commands/credentials/USAGE +4 -2
  23. data/lib/rails/commands/credentials/credentials_command/diffing.rb +26 -16
  24. data/lib/rails/commands/credentials/credentials_command.rb +6 -2
  25. data/lib/rails/commands/dbconsole/dbconsole_command.rb +16 -15
  26. data/lib/rails/commands/help/USAGE +3 -2
  27. data/lib/rails/commands/runner/runner_command.rb +3 -2
  28. data/lib/rails/commands/server/server_command.rb +2 -5
  29. data/lib/rails/configuration.rb +18 -23
  30. data/lib/rails/engine/configuration.rb +2 -2
  31. data/lib/rails/engine.rb +23 -27
  32. data/lib/rails/gem_version.rb +4 -4
  33. data/lib/rails/generators/actions/create_migration.rb +2 -4
  34. data/lib/rails/generators/actions.rb +35 -13
  35. data/lib/rails/generators/app_base.rb +66 -102
  36. data/lib/rails/generators/app_name.rb +1 -1
  37. data/lib/rails/generators/base.rb +9 -13
  38. data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +2 -0
  39. data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +8 -4
  40. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +5 -27
  41. data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +7 -3
  42. data/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +20 -0
  43. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +7 -16
  44. data/lib/rails/generators/erb.rb +1 -1
  45. data/lib/rails/generators/generated_attribute.rb +40 -4
  46. data/lib/rails/generators/migration.rb +2 -6
  47. data/lib/rails/generators/model_helpers.rb +1 -1
  48. data/lib/rails/generators/named_base.rb +1 -1
  49. data/lib/rails/generators/rails/app/app_generator.rb +44 -88
  50. data/lib/rails/generators/rails/app/templates/Gemfile.tt +41 -52
  51. data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +2 -2
  52. data/lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt +2 -2
  53. data/lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt +1 -1
  54. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +3 -10
  55. data/lib/rails/generators/rails/app/templates/bin/rails.tt +1 -4
  56. data/lib/rails/generators/rails/app/templates/bin/rake.tt +0 -3
  57. data/lib/rails/generators/rails/app/templates/bin/setup.tt +9 -14
  58. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +1 -1
  59. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +2 -2
  60. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +3 -3
  61. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +3 -3
  62. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +2 -2
  63. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +3 -3
  64. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +2 -2
  65. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +3 -3
  66. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
  67. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +5 -5
  68. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +2 -11
  69. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +9 -15
  70. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +2 -7
  71. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -5
  72. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +0 -5
  73. data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +2 -2
  74. data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt +4 -4
  75. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +85 -0
  76. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +3 -3
  77. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +1 -1
  78. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +3 -0
  79. data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +5 -5
  80. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +2 -2
  81. data/lib/rails/generators/rails/app/templates/gitattributes.tt +0 -5
  82. data/lib/rails/generators/rails/app/templates/gitignore.tt +0 -1
  83. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +1 -1
  84. data/lib/rails/generators/rails/controller/controller_generator.rb +1 -2
  85. data/lib/rails/generators/rails/controller/templates/controller.rb.tt +0 -4
  86. data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
  87. data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -1
  88. data/lib/rails/generators/rails/plugin/plugin_generator.rb +40 -15
  89. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +4 -2
  90. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +9 -9
  91. data/lib/rails/generators/rails/plugin/templates/README.md.tt +1 -1
  92. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +2 -2
  93. data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
  94. data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +0 -3
  95. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +4 -4
  96. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -5
  97. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +2 -2
  98. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt +1 -1
  99. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +2 -2
  100. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +3 -3
  101. data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +0 -19
  102. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -5
  103. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +6 -10
  104. data/lib/rails/generators/resource_helpers.rb +2 -2
  105. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +1 -1
  106. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
  107. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +3 -3
  108. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +5 -5
  109. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +2 -2
  110. data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +3 -3
  111. data/lib/rails/generators/testing/behaviour.rb +1 -2
  112. data/lib/rails/generators.rb +9 -22
  113. data/lib/rails/info.rb +1 -1
  114. data/lib/rails/info_controller.rb +1 -3
  115. data/lib/rails/initializable.rb +1 -1
  116. data/lib/rails/mailers_controller.rb +2 -4
  117. data/lib/rails/rack/logger.rb +0 -1
  118. data/lib/rails/railtie/configuration.rb +1 -2
  119. data/lib/rails/railtie.rb +9 -9
  120. data/lib/rails/ruby_version_check.rb +3 -3
  121. data/lib/rails/secrets.rb +8 -10
  122. data/lib/rails/tasks/framework.rake +2 -8
  123. data/lib/rails/tasks/statistics.rake +3 -1
  124. data/lib/rails/tasks/tmp.rake +8 -1
  125. data/lib/rails/tasks/yarn.rake +5 -1
  126. data/lib/rails/tasks/zeitwerk.rake +2 -10
  127. data/lib/rails/templates/layouts/application.html.erb +15 -0
  128. data/lib/rails/templates/rails/mailers/email.html.erb +12 -10
  129. data/lib/rails/templates/rails/welcome/index.html.erb +3 -0
  130. data/lib/rails/test_unit/railtie.rb +0 -4
  131. data/lib/rails/test_unit/runner.rb +7 -5
  132. data/lib/rails/test_unit/testing.rake +4 -9
  133. data/lib/rails.rb +1 -0
  134. metadata +37 -39
  135. data/lib/rails/command/spellchecker.rb +0 -57
  136. data/lib/rails/generators/css/assets/assets_generator.rb +0 -15
  137. data/lib/rails/generators/css/assets/templates/stylesheet.css +0 -4
  138. data/lib/rails/generators/css/scaffold/scaffold_generator.rb +0 -18
  139. data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +0 -6
  140. data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +0 -5
  141. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +0 -23
  142. data/lib/rails/generators/rails/app/templates/bin/spring.tt +0 -13
  143. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +0 -16
  144. data/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb.tt +0 -8
  145. data/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt +0 -5
  146. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +0 -67
  147. data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +0 -6
  148. data/lib/rails/generators/rails/app/templates/package.json.tt +0 -11
  149. data/lib/rails/generators/rails/assets/USAGE +0 -16
  150. data/lib/rails/generators/rails/assets/assets_generator.rb +0 -26
  151. data/lib/rails/generators/rails/assets/templates/stylesheet.css +0 -4
  152. data/lib/rails/generators/rails/scaffold/templates/scaffold.css +0 -80
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0") && RUBY_ENGINE == "ruby"
3
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7.0") && RUBY_ENGINE == "ruby"
4
4
  desc = defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE})"
5
5
  abort <<-end_message
6
6
 
7
- Rails 6 requires Ruby 2.5.0 or newer.
7
+ Rails 7 requires Ruby 2.7.0 or newer.
8
8
 
9
9
  You're running
10
10
  #{desc}
11
11
 
12
- Please upgrade to Ruby 2.5.0 or newer to continue.
12
+ Please upgrade to Ruby 2.7.0 or newer to continue.
13
13
 
14
14
  end_message
15
15
  end
data/lib/rails/secrets.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "yaml"
4
- require "tempfile"
5
4
  require "active_support/message_encryptor"
6
5
 
7
6
  module Rails
@@ -88,18 +87,17 @@ module Rails
88
87
  end
89
88
 
90
89
  def writing(contents)
91
- file_name = "#{File.basename(path)}.#{Process.pid}"
90
+ tmp_file = "#{File.basename(path)}.#{Process.pid}"
91
+ tmp_path = File.join(Dir.tmpdir, tmp_file)
92
+ IO.binwrite(tmp_path, contents)
92
93
 
93
- Tempfile.create(["", "-" + file_name]) do |tmp_file|
94
- tmp_path = Pathname.new(tmp_file)
95
- tmp_path.binwrite contents
94
+ yield tmp_path
96
95
 
97
- yield tmp_path
96
+ updated_contents = IO.binread(tmp_path)
98
97
 
99
- updated_contents = tmp_path.binread
100
-
101
- write(updated_contents) if updated_contents != contents
102
- end
98
+ write(updated_contents) if updated_contents != contents
99
+ ensure
100
+ FileUtils.rm(tmp_path) if File.exist?(tmp_path)
103
101
  end
104
102
 
105
103
  def encryptor
@@ -8,7 +8,7 @@ namespace :app do
8
8
  task template: :environment do
9
9
  template = ENV["LOCATION"]
10
10
  raise "No LOCATION value given. Please set LOCATION either as path to a file or a URL" if template.blank?
11
- template = File.expand_path(template) unless %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}.match?(template)
11
+ template = File.expand_path(template) unless %r{\A[A-Za-z][A-Za-z0-9+\-.]*://}.match?(template)
12
12
  require "rails/generators"
13
13
  require "rails/generators/rails/app/app_generator"
14
14
  generator = Rails::Generators::AppGenerator.new [Rails.root], {}, { destination_root: Rails.root }
@@ -22,7 +22,7 @@ namespace :app do
22
22
  project_templates = "#{Rails.root}/lib/templates"
23
23
 
24
24
  default_templates = { "erb" => %w{controller mailer scaffold},
25
- "rails" => %w{controller helper scaffold_controller assets} }
25
+ "rails" => %w{controller helper scaffold_controller} }
26
26
 
27
27
  default_templates.each do |type, names|
28
28
  local_template_type_dir = File.join(project_templates, type)
@@ -59,10 +59,4 @@ namespace :app do
59
59
  Rails::AppUpdater.invoke_from_app_generator :display_upgrade_guide_info
60
60
  end
61
61
  end
62
-
63
- namespace :binstub do
64
- task :yarn do
65
- Rails::AppUpdater.invoke_from_app_generator :update_bin_yarn
66
- end
67
- end
68
62
  end
@@ -11,17 +11,19 @@ STATS_DIRECTORIES ||= [
11
11
  %w(Mailers app/mailers),
12
12
  %w(Mailboxes app/mailboxes),
13
13
  %w(Channels app/channels),
14
+ %w(Views app/views),
14
15
  %w(JavaScripts app/assets/javascripts),
16
+ %w(Stylesheets app/assets/stylesheets),
15
17
  %w(JavaScript app/javascript),
16
18
  %w(Libraries lib/),
17
19
  %w(APIs app/apis),
18
20
  %w(Controller\ tests test/controllers),
19
21
  %w(Helper\ tests test/helpers),
22
+ %w(Job\ tests test/jobs),
20
23
  %w(Model\ tests test/models),
21
24
  %w(Mailer\ tests test/mailers),
22
25
  %w(Mailbox\ tests test/mailboxes),
23
26
  %w(Channel\ tests test/channels),
24
- %w(Job\ tests test/jobs),
25
27
  %w(Integration\ tests test/integration),
26
28
  %w(System\ tests test/system),
27
29
  ].collect do |name, dir|
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace :tmp do
4
4
  desc "Clear cache, socket and screenshot files from tmp/ (narrow w/ tmp:cache:clear, tmp:sockets:clear, tmp:screenshots:clear)"
5
- task clear: ["tmp:cache:clear", "tmp:sockets:clear", "tmp:screenshots:clear"]
5
+ task clear: ["tmp:cache:clear", "tmp:sockets:clear", "tmp:screenshots:clear", "tmp:storage:clear"]
6
6
 
7
7
  tmp_dirs = [ "tmp/cache",
8
8
  "tmp/sockets",
@@ -41,4 +41,11 @@ namespace :tmp do
41
41
  rm Dir["tmp/screenshots/[^.]*"], verbose: false
42
42
  end
43
43
  end
44
+
45
+ namespace :storage do
46
+ # desc "Clear all files and directories in tmp/storage"
47
+ task :clear do
48
+ rm_rf Dir["tmp/storage/[^.]*"], verbose: false
49
+ end
50
+ end
44
51
  end
@@ -16,7 +16,11 @@ namespace :yarn do
16
16
  "--immutable"
17
17
  end
18
18
 
19
- system({ "NODE_ENV" => node_env }, "#{RbConfig.ruby} \"#{Rails.root}/bin/yarn\" install #{yarn_flags}")
19
+ system(
20
+ { "NODE_ENV" => node_env },
21
+ "#{RbConfig.ruby} \"#{Rails.root}/bin/yarn\" install #{yarn_flags}",
22
+ exception: true
23
+ )
20
24
  rescue Errno::ENOENT
21
25
  $stderr.puts "bin/yarn was not found."
22
26
  $stderr.puts "Please run `bundle exec rails app:update:bin` to create it."
@@ -1,11 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ensure_zeitwerk_mode = ->() do
4
- unless Rails.autoloaders.zeitwerk_enabled?
5
- abort "Please, enable :zeitwerk mode in config/application.rb and try again."
6
- end
7
- end
8
-
9
3
  eager_load = ->() do
10
4
  puts "Hold on, I am eager loading the application."
11
5
  Zeitwerk::Loader.eager_load_all
@@ -41,8 +35,6 @@ end
41
35
  namespace :zeitwerk do
42
36
  desc "Checks project structure for Zeitwerk compatibility"
43
37
  task check: :environment do
44
- ensure_zeitwerk_mode[]
45
-
46
38
  begin
47
39
  eager_load[]
48
40
  rescue NameError => e
@@ -54,11 +46,11 @@ namespace :zeitwerk do
54
46
  end
55
47
 
56
48
  require "active_support/core_ext/object/try"
57
- eager_load_paths = Rails.configuration.eager_load_namespaces.map do |eln|
49
+ eager_load_paths = Rails.configuration.eager_load_namespaces.filter_map do |eln|
58
50
  # Quick regression fix for 6.0.3 to support namespaces that do not have
59
51
  # eager load paths, like the recently added i18n. I'll rewrite this task.
60
52
  eln.try(:config).try(:eager_load_paths)
61
- end.compact.flatten
53
+ end.flatten
62
54
 
63
55
  not_checked = ActiveSupport::Dependencies.autoload_paths - eager_load_paths
64
56
  not_checked.select! { |dir| Dir.exist?(dir) }
@@ -25,6 +25,21 @@
25
25
 
26
26
  h2 { padding-left: 10px; }
27
27
 
28
+ @media (prefers-color-scheme: dark) {
29
+ body {
30
+ background-color: #222;
31
+ color: #ececec;
32
+ }
33
+
34
+ pre {
35
+ background-color: #333;
36
+ }
37
+
38
+ a { color: #fff; }
39
+ a:visited { color: #999; }
40
+ a:hover { color: #000; background-color: #fff; }
41
+ }
42
+
28
43
  <%= yield :style %>
29
44
  </style>
30
45
  </head>
@@ -56,35 +56,35 @@
56
56
  <dl>
57
57
  <% if @email.respond_to?(:smtp_envelope_from) && Array(@email.from) != Array(@email.smtp_envelope_from) %>
58
58
  <dt>SMTP-From:</dt>
59
- <dd><%= @email.smtp_envelope_from %></dd>
59
+ <dd id="smtp_from"><%= @email.smtp_envelope_from %></dd>
60
60
  <% end %>
61
61
 
62
62
  <% if @email.respond_to?(:smtp_envelope_to) && @email.to != @email.smtp_envelope_to %>
63
63
  <dt>SMTP-To:</dt>
64
- <dd><%= @email.smtp_envelope_to %></dd>
64
+ <dd id="smtp_to"><%= @email.smtp_envelope_to %></dd>
65
65
  <% end %>
66
66
 
67
67
  <dt>From:</dt>
68
- <dd><%= @email.header['from'] %></dd>
68
+ <dd id="from"><%= @email.header['from'] %></dd>
69
69
 
70
70
  <% if @email.reply_to %>
71
71
  <dt>Reply-To:</dt>
72
- <dd><%= @email.header['reply-to'] %></dd>
72
+ <dd id="reply_to"><%= @email.header['reply-to'] %></dd>
73
73
  <% end %>
74
74
 
75
75
  <dt>To:</dt>
76
- <dd><%= @email.header['to'] %></dd>
76
+ <dd id="to"><%= @email.header['to'] %></dd>
77
77
 
78
78
  <% if @email.cc %>
79
79
  <dt>CC:</dt>
80
- <dd><%= @email.header['cc'] %></dd>
80
+ <dd id="cc"><%= @email.header['cc'] %></dd>
81
81
  <% end %>
82
82
 
83
83
  <dt>Date:</dt>
84
- <dd><%= Time.current.rfc2822 %></dd>
84
+ <dd id="date"><%= Time.current.rfc2822 %></dd>
85
85
 
86
86
  <dt>Subject:</dt>
87
- <dd><strong><%= @email.subject %></strong></dd>
87
+ <dd><strong id="subject"><%= @email.subject %></strong></dd>
88
88
 
89
89
  <% unless @email.attachments.nil? || @email.attachments.empty? %>
90
90
  <dt>Attachments:</dt>
@@ -97,15 +97,17 @@
97
97
  <% end %>
98
98
 
99
99
  <dt>Format:</dt>
100
- <% if @email.multipart? %>
100
+ <% if @email.html_part && @email.text_part %>
101
101
  <dd>
102
102
  <select id="part" onchange="refreshBody(false);">
103
103
  <option <%= request.format == Mime[:html] ? 'selected' : '' %> value="<%= part_query('text/html') %>">View as HTML email</option>
104
104
  <option <%= request.format == Mime[:text] ? 'selected' : '' %> value="<%= part_query('text/plain') %>">View as plain-text email</option>
105
105
  </select>
106
106
  </dd>
107
+ <% elsif @part %>
108
+ <dd id="mime_type" data-mime-type="<%= part_query(@part.mime_type) %>"><%= @part.mime_type == 'text/html' ? 'HTML email' : 'plain-text email' %></dd>
107
109
  <% else %>
108
- <dd id="mime_type" data-mime-type="<%= part_query(@email.mime_type) %>"><%= @email.mime_type == 'text/html' ? 'HTML email' : 'plain-text email' %></dd>
110
+ <dd id="mime_type" data-mime-type=""></dd>
109
111
  <% end %>
110
112
 
111
113
  <% if I18n.available_locales.count > 1 %>
@@ -1,9 +1,12 @@
1
+ <% ruby_on_rails_logo_favicon_data_uri = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwcHgiIGhlaWdodD0iMzIwcHgiIHZpZXdCb3g9IjAgMCAzMjAgMzIwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPkljb248L3RpdGxlPgogICAgPGcgaWQ9Ikljb24iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJSdWJ5LU9uLVJhaWxzLUxvZ28iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUuMDAwMDAwLCAyMC4wMDAwMDApIiBmaWxsPSIjRDgxRTAwIj4KICAgICAgICAgICAgPHBhdGggZD0iTTIxLjkzMzA3MDYsMjg1IEwxNjguMTc1NDI2LDI4NSBDMTQ3Ljk0MDg1OCwxNTAuNjkxNzA2IDE5Ni44ODIzODMsNjYuMzE0MjkwMiAzMTUsMzEuODY3NzUzNiBDMzE1LDIxLjc4NTEyODQgMzE1LDMxLjg2Nzc1MzYgMzE1LDIxLjc4NTEyODQgQzE2MS4yNTI4MywyNC45MTE2Mjc4IDYzLjU2Mzg1MzMsMTEyLjY0OTkxOCAyMS45MzMwNzA2LDI4NSBaIiBpZD0iUGF0aCIvPgogICAgICAgICAgICA8cG9seWdvbiBpZD0iUGF0aCIgcG9pbnRzPSI0MC40MDgyNjQzIDE4NS45MTU3MSAxMi43MzI2NDk0IDE3NC40MDE2NjMgLTEuNDIxMDg1NDdlLTE0IDIwNS40NDI3MSAyOS41NzExOTY2IDIxNi42NDcxMTUiLz4KICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlBhdGgiIHBvaW50cz0iMTgwLjQ3MzEwMiAyNjguMDczNjQzIDIwNC45MzYwMTYgMjc2LjQxMDk2NiAyMDQuOTM2MDE2IDI1NC41MDg2NzMgMTgwLjQ4OTY0NCAyNDQuMzM4MTA3Ii8+CiAgICAgICAgICAgIDxwb2x5Z29uIGlkPSJQYXRoIiBwb2ludHM9IjEwMC41ODk1MTkgOTcuMjI4NzYwNiA3Ni42ODQwMTU2IDc5LjE2ODcwMjEgNTUuMjQ0MDc5MSAxMDAuMTgzMTA1IDgxLjUxNDMyMzkgMTE3LjQzMzcyNSIvPgogICAgICAgICAgICA8cG9seWdvbiBpZD0iUGF0aCIgcG9pbnRzPSIxODQuNTc1Njc5IDE4NC44OTYyOTUgMjA3Ljk1MjAzIDIwMC4yNDY2MSAyMTEuNzI3NzI5IDE4MS4yMDUyNjYgMTg5Ljg2MzY1MyAxNjQuNjg3NDYiLz4KICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlBhdGgiIHBvaW50cz0iMjYxLjczNDAxIDY1Ljg5NTk0NDYgMjY5LjM1NDIzNCA4Mi4zMjk1NCAyODUuMzE4MjU2IDcyLjcwNDg1OTYgMjc4LjMxMDEyOSA1Ni45ODI5ODk1Ii8+CiAgICAgICAgICAgIDxwb2x5Z29uIGlkPSJQYXRoIiBwb2ludHM9IjI2MS45MTM3IDE2LjE4NDU0NzMgMjU1LjU5ODQ3OSA3LjEwNTQyNzM2ZS0xNSAyMzIuNzk2MDIgMy40ODg5NjMyMyAyNDAuNDYzODczIDIwLjAyNTI3MjUiLz4KICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlBhdGgiIHBvaW50cz0iMjExLjkzNDExOSAxMTEuNTgwNjc1IDIyNi43MjI1NDcgMTI3Ljc5MjYwMSAyMzguMDIzOTI1IDExMy45MDM3MTUgMjIzLjQ2ODM3NSA5Ni41NDY4Njg1Ii8+CiAgICAgICAgICAgIDxwb2x5Z29uIGlkPSJQYXRoIiBwb2ludHM9IjE3OS42ODY4NTggMzguNDk1MjIxOCAxNjQuNjQxOTMxIDIwLjAyNTI3MjUgMTM5Ljg0NzYyIDMyLjU1NTI5OTIgMTU2LjYwMTMyNCA1MC45MjE2NzUzIi8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=" %>
1
2
  <!DOCTYPE html>
2
3
  <html>
3
4
  <head>
4
5
  <title>Ruby on Rails</title>
5
6
  <meta charset="utf-8">
6
7
  <meta name="viewport" content="width=device-width">
8
+ <link rel="shortcut icon" href="<%= ruby_on_rails_logo_favicon_data_uri %>" />
9
+
7
10
  <style type="text/css" media="screen" charset="utf-8">
8
11
  body {
9
12
  font-family: Georgia, sans-serif;
@@ -2,10 +2,6 @@
2
2
 
3
3
  require "rails/test_unit/line_filtering"
4
4
 
5
- if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
6
- ENV["RAILS_ENV"] ||= Rake.application.options.show_tasks ? "development" : "test"
7
- end
8
-
9
5
  module Rails
10
6
  class TestUnitRailtie < Rails::Railtie
11
7
  config.app_generators do |c|
@@ -3,6 +3,7 @@
3
3
  require "shellwords"
4
4
  require "method_source"
5
5
  require "rake/file_list"
6
+ require "active_support"
6
7
  require "active_support/core_ext/module/attribute_accessors"
7
8
 
8
9
  module Rails
@@ -30,9 +31,9 @@ module Rails
30
31
  end
31
32
 
32
33
  def rake_run(argv = [])
33
- ARGV.replace Shellwords.split(ENV["TESTOPTS"] || "")
34
-
35
- run(argv)
34
+ # Ensure the tests run during the Rake Task action, not when the process exits
35
+ success = system("rails", "test", *argv, *Shellwords.split(ENV["TESTOPTS"] || ""))
36
+ success || exit(false)
36
37
  end
37
38
 
38
39
  def run(argv = [])
@@ -46,7 +47,6 @@ module Rails
46
47
 
47
48
  tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
48
49
  tests.exclude(default_test_exclude_glob) if patterns.empty?
49
-
50
50
  tests.to_a.each { |path| require File.expand_path(path) }
51
51
  end
52
52
 
@@ -61,7 +61,9 @@ module Rails
61
61
  private
62
62
  def extract_filters(argv)
63
63
  # Extract absolute and relative paths but skip -n /.*/ regexp filters.
64
- argv.select { |arg| path_argument?(arg) && !regexp_filter?(arg) }.map do |path|
64
+ argv.filter_map do |path|
65
+ next unless path_argument?(path) && !regexp_filter?(path)
66
+
65
67
  path = path.tr("\\", "/")
66
68
  case
67
69
  when /(:\d+)+$/.match?(path)
@@ -8,8 +8,6 @@ task default: :test
8
8
 
9
9
  desc "Runs all tests in test folder except system ones"
10
10
  task :test do
11
- $: << "test"
12
-
13
11
  if ENV.key?("TEST")
14
12
  Rails::TestUnit::Runner.rake_run([ENV["TEST"]])
15
13
  else
@@ -26,39 +24,36 @@ namespace :test do
26
24
  task run: %w[test]
27
25
 
28
26
  desc "Run tests quickly, but also reset db"
29
- task db: %w[db:test:prepare test]
27
+ task :db do
28
+ success = system({ "RAILS_ENV" => ENV.fetch("RAILS_ENV", "test") }, "rake", "db:test:prepare", "test")
29
+ success || exit(false)
30
+ end
30
31
 
31
32
  ["models", "helpers", "channels", "controllers", "mailers", "integration", "jobs", "mailboxes"].each do |name|
32
33
  task name => "test:prepare" do
33
- $: << "test"
34
34
  Rails::TestUnit::Runner.rake_run(["test/#{name}"])
35
35
  end
36
36
  end
37
37
 
38
38
  desc "Runs all tests, including system tests"
39
39
  task all: "test:prepare" do
40
- $: << "test"
41
40
  Rails::TestUnit::Runner.rake_run(["test/**/*_test.rb"])
42
41
  end
43
42
 
44
43
  task generators: "test:prepare" do
45
- $: << "test"
46
44
  Rails::TestUnit::Runner.rake_run(["test/lib/generators"])
47
45
  end
48
46
 
49
47
  task units: "test:prepare" do
50
- $: << "test"
51
48
  Rails::TestUnit::Runner.rake_run(["test/models", "test/helpers", "test/unit"])
52
49
  end
53
50
 
54
51
  task functionals: "test:prepare" do
55
- $: << "test"
56
52
  Rails::TestUnit::Runner.rake_run(["test/controllers", "test/mailers", "test/functional"])
57
53
  end
58
54
 
59
55
  desc "Run system tests only"
60
56
  task system: "test:prepare" do
61
- $: << "test"
62
57
  Rails::TestUnit::Runner.rake_run(["test/system"])
63
58
  end
64
59
  end
data/lib/rails.rb CHANGED
@@ -25,6 +25,7 @@ end
25
25
 
26
26
  module Rails
27
27
  extend ActiveSupport::Autoload
28
+ extend ActiveSupport::Benchmarkable
28
29
 
29
30
  autoload :Info
30
31
  autoload :InfoController
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: 6.1.7.8
4
+ version: 7.0.0.alpha1
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-06-04 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.7.8
19
+ version: 7.0.0.alpha1
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: 6.1.7.8
26
+ version: 7.0.0.alpha1
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: 6.1.7.8
33
+ version: 7.0.0.alpha1
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: 6.1.7.8
40
+ version: 7.0.0.alpha1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '12.2'
47
+ version: '0.13'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '12.2'
54
+ version: '0.13'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +80,34 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: zeitwerk
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.5.0.beta3
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.5.0.beta3
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: actionview
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - '='
88
102
  - !ruby/object:Gem::Version
89
- version: 6.1.7.8
103
+ version: 7.0.0.alpha1
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - '='
95
109
  - !ruby/object:Gem::Version
96
- version: 6.1.7.8
110
+ version: 7.0.0.alpha1
97
111
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
98
112
  email: david@loudthinking.com
99
113
  executables:
@@ -122,6 +136,7 @@ files:
122
136
  - lib/rails/application/routes_reloader.rb
123
137
  - lib/rails/application_controller.rb
124
138
  - lib/rails/autoloaders.rb
139
+ - lib/rails/autoloaders/inflector.rb
125
140
  - lib/rails/backtrace_cleaner.rb
126
141
  - lib/rails/cli.rb
127
142
  - lib/rails/code_statistics.rb
@@ -132,7 +147,6 @@ files:
132
147
  - lib/rails/command/behavior.rb
133
148
  - lib/rails/command/environment_argument.rb
134
149
  - lib/rails/command/helpers/editor.rb
135
- - lib/rails/command/spellchecker.rb
136
150
  - lib/rails/commands.rb
137
151
  - lib/rails/commands/application/application_command.rb
138
152
  - lib/rails/commands/console/console_command.rb
@@ -178,9 +192,6 @@ files:
178
192
  - lib/rails/generators/app_base.rb
179
193
  - lib/rails/generators/app_name.rb
180
194
  - lib/rails/generators/base.rb
181
- - lib/rails/generators/css/assets/assets_generator.rb
182
- - lib/rails/generators/css/assets/templates/stylesheet.css
183
- - lib/rails/generators/css/scaffold/scaffold_generator.rb
184
195
  - lib/rails/generators/database.rb
185
196
  - lib/rails/generators/erb.rb
186
197
  - lib/rails/generators/erb/controller/controller_generator.rb
@@ -195,6 +206,7 @@ files:
195
206
  - lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt
196
207
  - lib/rails/generators/erb/scaffold/templates/index.html.erb.tt
197
208
  - lib/rails/generators/erb/scaffold/templates/new.html.erb.tt
209
+ - lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt
198
210
  - lib/rails/generators/erb/scaffold/templates/show.html.erb.tt
199
211
  - lib/rails/generators/generated_attribute.rb
200
212
  - lib/rails/generators/migration.rb
@@ -211,9 +223,6 @@ files:
211
223
  - lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb.tt
212
224
  - lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt
213
225
  - lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb.tt
214
- - lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js
215
- - lib/rails/generators/rails/app/templates/app/javascript/channels/index.js
216
- - lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt
217
226
  - lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt
218
227
  - lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt
219
228
  - lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt
@@ -223,8 +232,6 @@ files:
223
232
  - lib/rails/generators/rails/app/templates/bin/rails.tt
224
233
  - lib/rails/generators/rails/app/templates/bin/rake.tt
225
234
  - lib/rails/generators/rails/app/templates/bin/setup.tt
226
- - lib/rails/generators/rails/app/templates/bin/spring.tt
227
- - lib/rails/generators/rails/app/templates/bin/yarn.tt
228
235
  - lib/rails/generators/rails/app/templates/config.ru.tt
229
236
  - lib/rails/generators/rails/app/templates/config/application.rb.tt
230
237
  - lib/rails/generators/rails/app/templates/config/boot.rb.tt
@@ -242,27 +249,23 @@ files:
242
249
  - lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
243
250
  - lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
244
251
  - lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
245
- - lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb.tt
246
252
  - lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt
247
253
  - lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt
248
254
  - lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt
249
- - lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt
250
255
  - lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt
251
256
  - lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt
252
257
  - lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt
253
258
  - lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb.tt
254
- - lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt
259
+ - lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt
255
260
  - lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt
256
261
  - lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
257
262
  - lib/rails/generators/rails/app/templates/config/locales/en.yml
258
263
  - lib/rails/generators/rails/app/templates/config/puma.rb.tt
259
264
  - lib/rails/generators/rails/app/templates/config/routes.rb.tt
260
- - lib/rails/generators/rails/app/templates/config/spring.rb.tt
261
265
  - lib/rails/generators/rails/app/templates/config/storage.yml.tt
262
266
  - lib/rails/generators/rails/app/templates/db/seeds.rb.tt
263
267
  - lib/rails/generators/rails/app/templates/gitattributes.tt
264
268
  - lib/rails/generators/rails/app/templates/gitignore.tt
265
- - lib/rails/generators/rails/app/templates/package.json.tt
266
269
  - lib/rails/generators/rails/app/templates/public/404.html
267
270
  - lib/rails/generators/rails/app/templates/public/422.html
268
271
  - lib/rails/generators/rails/app/templates/public/500.html
@@ -275,9 +278,6 @@ files:
275
278
  - lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt
276
279
  - lib/rails/generators/rails/app/templates/test/test_helper.rb.tt
277
280
  - lib/rails/generators/rails/application_record/application_record_generator.rb
278
- - lib/rails/generators/rails/assets/USAGE
279
- - lib/rails/generators/rails/assets/assets_generator.rb
280
- - lib/rails/generators/rails/assets/templates/stylesheet.css
281
281
  - lib/rails/generators/rails/benchmark/USAGE
282
282
  - lib/rails/generators/rails/benchmark/benchmark_generator.rb
283
283
  - lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt
@@ -340,7 +340,6 @@ files:
340
340
  - lib/rails/generators/rails/resource_route/resource_route_generator.rb
341
341
  - lib/rails/generators/rails/scaffold/USAGE
342
342
  - lib/rails/generators/rails/scaffold/scaffold_generator.rb
343
- - lib/rails/generators/rails/scaffold/templates/scaffold.css
344
343
  - lib/rails/generators/rails/scaffold_controller/USAGE
345
344
  - lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
346
345
  - lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt
@@ -426,12 +425,11 @@ licenses:
426
425
  - MIT
427
426
  metadata:
428
427
  bug_tracker_uri: https://github.com/rails/rails/issues
429
- changelog_uri: https://github.com/rails/rails/blob/v6.1.7.8/railties/CHANGELOG.md
430
- documentation_uri: https://api.rubyonrails.org/v6.1.7.8/
428
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.0.alpha1/railties/CHANGELOG.md
429
+ documentation_uri: https://api.rubyonrails.org/v7.0.0.alpha1/
431
430
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
432
- source_code_uri: https://github.com/rails/rails/tree/v6.1.7.8/railties
433
- rubygems_mfa_required: 'true'
434
- post_install_message:
431
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.0.alpha1/railties
432
+ post_install_message:
435
433
  rdoc_options:
436
434
  - "--exclude"
437
435
  - "."
@@ -441,15 +439,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
441
439
  requirements:
442
440
  - - ">="
443
441
  - !ruby/object:Gem::Version
444
- version: 2.5.0
442
+ version: 2.7.0
445
443
  required_rubygems_version: !ruby/object:Gem::Requirement
446
444
  requirements:
447
- - - ">="
445
+ - - ">"
448
446
  - !ruby/object:Gem::Version
449
- version: '0'
447
+ version: 1.3.1
450
448
  requirements: []
451
- rubygems_version: 3.3.27
452
- signing_key:
449
+ rubygems_version: 3.1.6
450
+ signing_key:
453
451
  specification_version: 4
454
452
  summary: Tools for creating, working with, and running Rails applications.
455
453
  test_files: []