railties 6.0.6.1 → 6.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +225 -469
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +1 -1
  5. data/README.rdoc +1 -1
  6. data/lib/minitest/rails_plugin.rb +16 -1
  7. data/lib/rails/api/task.rb +1 -1
  8. data/lib/rails/application/bootstrap.rb +5 -5
  9. data/lib/rails/application/configuration.rb +53 -26
  10. data/lib/rails/application/default_middleware_stack.rb +5 -3
  11. data/lib/rails/application/finisher.rb +15 -2
  12. data/lib/rails/application/routes_reloader.rb +9 -2
  13. data/lib/rails/application.rb +45 -79
  14. data/lib/rails/backtrace_cleaner.rb +12 -7
  15. data/lib/rails/code_statistics.rb +3 -3
  16. data/lib/rails/code_statistics_calculator.rb +6 -6
  17. data/lib/rails/command/base.rb +1 -1
  18. data/lib/rails/command/behavior.rb +1 -1
  19. data/lib/rails/command/environment_argument.rb +1 -1
  20. data/lib/rails/command.rb +7 -1
  21. data/lib/rails/commands/credentials/USAGE +17 -2
  22. data/lib/rails/commands/credentials/credentials_command/diffing.rb +41 -0
  23. data/lib/rails/commands/credentials/credentials_command.rb +28 -4
  24. data/lib/rails/commands/db/system/change/change_command.rb +6 -1
  25. data/lib/rails/commands/dbconsole/dbconsole_command.rb +59 -57
  26. data/lib/rails/commands/encrypted/encrypted_command.rb +4 -4
  27. data/lib/rails/commands/generate/generate_command.rb +1 -1
  28. data/lib/rails/commands/notes/notes_command.rb +3 -13
  29. data/lib/rails/commands/rake/rake_command.rb +9 -8
  30. data/lib/rails/commands/secrets/USAGE +9 -3
  31. data/lib/rails/commands/server/server_command.rb +14 -41
  32. data/lib/rails/commands/test/test_command.rb +2 -2
  33. data/lib/rails/configuration.rb +40 -10
  34. data/lib/rails/engine/configuration.rb +1 -0
  35. data/lib/rails/engine/updater.rb +1 -1
  36. data/lib/rails/engine.rb +26 -15
  37. data/lib/rails/gem_version.rb +3 -3
  38. data/lib/rails/generators/actions/create_migration.rb +5 -0
  39. data/lib/rails/generators/actions.rb +48 -27
  40. data/lib/rails/generators/app_base.rb +32 -17
  41. data/lib/rails/generators/base.rb +14 -11
  42. data/lib/rails/generators/database.rb +3 -4
  43. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +2 -2
  44. data/lib/rails/generators/generated_attribute.rb +3 -9
  45. data/lib/rails/generators/migration.rb +2 -1
  46. data/lib/rails/generators/model_helpers.rb +26 -2
  47. data/lib/rails/generators/named_base.rb +1 -1
  48. data/lib/rails/generators/rails/app/USAGE +2 -1
  49. data/lib/rails/generators/rails/app/app_generator.rb +89 -15
  50. data/lib/rails/generators/rails/app/templates/Gemfile.tt +10 -10
  51. data/lib/rails/generators/rails/app/templates/Rakefile.tt +1 -1
  52. data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +1 -1
  53. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +11 -4
  54. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +2 -1
  55. data/lib/rails/generators/rails/app/templates/bin/rails.tt +2 -2
  56. data/lib/rails/generators/rails/app/templates/bin/rake.tt +2 -2
  57. data/lib/rails/generators/rails/app/templates/bin/setup.tt +4 -4
  58. data/lib/rails/generators/rails/app/templates/bin/spring.tt +7 -0
  59. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +5 -7
  60. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +7 -3
  61. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +8 -2
  62. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +3 -4
  63. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +10 -9
  64. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +11 -10
  65. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +10 -9
  66. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +11 -10
  67. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +11 -10
  68. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +10 -9
  69. data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +1 -1
  70. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +17 -3
  71. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +14 -4
  72. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +12 -1
  73. data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +4 -3
  74. data/lib/rails/generators/rails/app/templates/config/initializers/feature_policy.rb.tt +11 -0
  75. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -1
  76. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +45 -0
  77. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +1 -1
  78. data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -1
  79. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +1 -1
  80. data/lib/rails/generators/rails/app/templates/gitattributes.tt +14 -0
  81. data/lib/rails/generators/rails/app/templates/gitignore.tt +0 -1
  82. data/lib/rails/generators/rails/app/templates/package.json.tt +1 -1
  83. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +5 -5
  84. data/lib/rails/generators/rails/assets/USAGE +2 -3
  85. data/lib/rails/generators/rails/benchmark/USAGE +19 -0
  86. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +29 -0
  87. data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
  88. data/lib/rails/generators/rails/controller/USAGE +2 -2
  89. data/lib/rails/generators/rails/controller/controller_generator.rb +2 -40
  90. data/lib/rails/generators/rails/credentials/credentials_generator.rb +1 -1
  91. data/lib/rails/generators/rails/generator/USAGE +2 -2
  92. data/lib/rails/generators/rails/generator/templates/USAGE.tt +1 -1
  93. data/lib/rails/generators/rails/helper/USAGE +2 -3
  94. data/lib/rails/generators/rails/integration_test/USAGE +2 -2
  95. data/lib/rails/generators/rails/migration/USAGE +4 -4
  96. data/lib/rails/generators/rails/model/USAGE +15 -16
  97. data/lib/rails/generators/rails/plugin/plugin_generator.rb +24 -23
  98. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +10 -19
  99. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +3 -10
  100. data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +4 -18
  101. data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +0 -1
  102. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +3 -3
  103. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +13 -11
  104. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +1 -0
  105. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +1 -1
  106. data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +4 -4
  107. data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +1 -1
  108. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +0 -3
  109. data/lib/rails/generators/rails/resource/USAGE +4 -4
  110. data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +2 -27
  111. data/lib/rails/generators/rails/scaffold/USAGE +5 -5
  112. data/lib/rails/generators/rails/scaffold_controller/USAGE +2 -2
  113. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +6 -0
  114. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -1
  115. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +1 -1
  116. data/lib/rails/generators/rails/system_test/USAGE +2 -2
  117. data/lib/rails/generators/rails/task/USAGE +3 -3
  118. data/lib/rails/generators/test_case.rb +1 -1
  119. data/lib/rails/generators/test_unit/controller/controller_generator.rb +2 -0
  120. data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +3 -3
  121. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +2 -2
  122. data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +1 -1
  123. data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +1 -1
  124. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +1 -1
  125. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +1 -1
  126. data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +1 -1
  127. data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +1 -1
  128. data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -2
  129. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +1 -1
  130. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +1 -1
  131. data/lib/rails/generators/testing/assertions.rb +2 -2
  132. data/lib/rails/generators/testing/behaviour.rb +1 -1
  133. data/lib/rails/generators.rb +29 -15
  134. data/lib/rails/info.rb +1 -1
  135. data/lib/rails/info_controller.rb +1 -1
  136. data/lib/rails/mailers_controller.rb +1 -0
  137. data/lib/rails/paths.rb +14 -6
  138. data/lib/rails/railtie/configuration.rb +3 -2
  139. data/lib/rails/railtie.rb +28 -3
  140. data/lib/rails/source_annotation_extractor.rb +1 -15
  141. data/lib/rails/tasks/engine.rake +1 -4
  142. data/lib/rails/tasks/framework.rake +7 -1
  143. data/lib/rails/tasks/misc.rake +1 -1
  144. data/lib/rails/tasks/statistics.rake +1 -1
  145. data/lib/rails/tasks.rb +0 -4
  146. data/lib/rails/templates/rails/mailers/email.html.erb +1 -0
  147. data/lib/rails/templates/rails/welcome/index.html.erb +1 -1
  148. data/lib/rails/test_unit/reporter.rb +2 -1
  149. data/lib/rails/test_unit/runner.rb +12 -3
  150. data/lib/rails/test_unit/testing.rake +6 -0
  151. data/lib/rails.rb +5 -8
  152. metadata +29 -36
  153. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +0 -50
  154. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +0 -86
  155. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +0 -45
  156. data/lib/rails/generators/rails/plugin/templates/rails/application.rb.tt +0 -23
  157. data/lib/rails/tasks/annotations.rake +0 -22
  158. data/lib/rails/tasks/dev.rake +0 -11
  159. data/lib/rails/tasks/initializers.rake +0 -9
  160. data/lib/rails/tasks/routes.rake +0 -9
data/lib/rails/paths.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pathname"
4
+
3
5
  module Rails
4
6
  module Paths
5
7
  # This object is an extended hash that behaves as root of the <tt>Rails::Paths</tt> system.
@@ -180,6 +182,14 @@ module Rails
180
182
  @paths
181
183
  end
182
184
 
185
+ def paths
186
+ raise "You need to set a path root" unless @root.path
187
+
188
+ map do |p|
189
+ Pathname.new(@root.path).join(p)
190
+ end
191
+ end
192
+
183
193
  def extensions # :nodoc:
184
194
  $1.split(",") if @glob =~ /\{([\S]+)\}/
185
195
  end
@@ -223,12 +233,10 @@ module Rails
223
233
 
224
234
  private
225
235
  def files_in(path)
226
- Dir.chdir(path) do
227
- files = Dir.glob(@glob)
228
- files -= @exclude if @exclude
229
- files.map! { |file| File.join(path, file) }
230
- files.sort
231
- end
236
+ files = Dir.glob(@glob, base: path)
237
+ files -= @exclude if @exclude
238
+ files.map! { |file| File.join(path, file) }
239
+ files.sort
232
240
  end
233
241
  end
234
242
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rails/configuration"
4
+ require "active_support/core_ext/symbol/starts_ends_with"
4
5
 
5
6
  module Rails
6
7
  class Railtie
@@ -88,8 +89,8 @@ module Rails
88
89
 
89
90
  private
90
91
  def method_missing(name, *args, &blk)
91
- if name.to_s =~ /=$/
92
- @@options[$`.to_sym] = args.first
92
+ if name.end_with?("=")
93
+ @@options[:"#{name[0..-2]}"] = args.first
93
94
  elsif @@options.key?(name)
94
95
  @@options[name]
95
96
  else
data/lib/rails/railtie.rb CHANGED
@@ -42,7 +42,7 @@ module Rails
42
42
  # end
43
43
  #
44
44
  # # lib/my_gem.rb
45
- # require 'my_gem/railtie' if defined?(Rails)
45
+ # require "my_gem/railtie" if defined?(Rails::Railtie)
46
46
  #
47
47
  # == Initializers
48
48
  #
@@ -91,7 +91,7 @@ module Rails
91
91
  #
92
92
  # class MyRailtie < Rails::Railtie
93
93
  # rake_tasks do
94
- # load 'path/to/my_railtie.tasks'
94
+ # load "path/to/my_railtie.tasks"
95
95
  # end
96
96
  # end
97
97
  #
@@ -101,13 +101,30 @@ module Rails
101
101
  #
102
102
  # class MyRailtie < Rails::Railtie
103
103
  # generators do
104
- # require 'path/to/my_railtie_generator'
104
+ # require "path/to/my_railtie_generator"
105
105
  # end
106
106
  # end
107
107
  #
108
108
  # Since filenames on the load path are shared across gems, be sure that files you load
109
109
  # through a railtie have unique names.
110
110
  #
111
+ # == Run another program when the Rails server starts
112
+ #
113
+ # In development, it's very usual to have to run another process next to the Rails Server. In example
114
+ # you might want to start the Webpack or React server. Or maybe you need to run your job scheduler process
115
+ # like Sidekiq. This is usually done by opening a new shell and running the program from here.
116
+ #
117
+ # Rails allow you to specify a +server+ block which will get called when a Rails server starts.
118
+ # This way, your users don't need to remember to have to open a new shell and run another program, making
119
+ # this less confusing for everyone.
120
+ # It can be used like this:
121
+ #
122
+ # class MyRailtie < Rails::Railtie
123
+ # server do
124
+ # WebpackServer.start
125
+ # end
126
+ # end
127
+ #
111
128
  # == Application and Engine
112
129
  #
113
130
  # An engine is nothing more than a railtie with some initializers already set. And since
@@ -152,6 +169,10 @@ module Rails
152
169
  register_block_for(:generators, &blk)
153
170
  end
154
171
 
172
+ def server(&blk)
173
+ register_block_for(:server, &blk)
174
+ end
175
+
155
176
  def abstract_railtie?
156
177
  ABSTRACT_RAILTIES.include?(name)
157
178
  end
@@ -246,6 +267,10 @@ module Rails
246
267
  each_registered_block(:rake_tasks) { |block| instance_exec(app, &block) }
247
268
  end
248
269
 
270
+ def run_server_blocks(app) #:nodoc:
271
+ each_registered_block(:server) { |block| block.call(app) }
272
+ end
273
+
249
274
  private
250
275
  # run `&block` in every registered block in `#register_block_for`
251
276
  def each_registered_block(type, &block)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/deprecation"
4
-
5
3
  module Rails
6
4
  # Implements the logic behind <tt>Rails::Command::NotesCommand</tt>. See <tt>rails notes --help</tt> for usage information.
7
5
  #
@@ -59,13 +57,6 @@ module Rails
59
57
  s << "[#{tag}] " if options[:tag]
60
58
  s << text
61
59
  end
62
-
63
- # Used in annotations.rake
64
- #:nodoc:
65
- def self.notes_task_deprecation_warning
66
- ActiveSupport::Deprecation.warn("This rake task is deprecated and will be removed in Rails 6.1. \nRefer to `rails notes --help` for more information.\n")
67
- puts "\n"
68
- end
69
60
  end
70
61
 
71
62
  # Prints all annotations with tag +tag+ under the root directories +app+,
@@ -109,7 +100,7 @@ module Rails
109
100
  results = {}
110
101
 
111
102
  Dir.glob("#{dir}/*") do |item|
112
- next if File.basename(item)[0] == ?.
103
+ next if File.basename(item).start_with?(".")
113
104
 
114
105
  if File.directory?(item)
115
106
  results.update(find_in(item))
@@ -155,8 +146,3 @@ module Rails
155
146
  end
156
147
  end
157
148
  end
158
-
159
- # Remove this deprecated class in the next minor version
160
- #:nodoc:
161
- SourceAnnotationExtractor = ActiveSupport::Deprecation::DeprecatedConstantProxy.
162
- new("SourceAnnotationExtractor", "Rails::SourceAnnotationExtractor")
@@ -53,7 +53,7 @@ namespace :db do
53
53
  desc "Rolls the schema back to the previous version (specify steps w/ STEP=n)."
54
54
  app_task "rollback"
55
55
 
56
- desc "Create a db/schema.rb file that can be portably used against any database supported by Active Record"
56
+ desc "Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `config.active_record.schema_format`)"
57
57
  app_task "schema:dump"
58
58
 
59
59
  desc "Load a schema.rb file into the database"
@@ -65,9 +65,6 @@ namespace :db do
65
65
  desc "Create the database, load the schema, and initialize with the seed data (use db:reset to also drop the database first)"
66
66
  app_task "setup"
67
67
 
68
- desc "Dump the database structure to an SQL file"
69
- app_task "structure:dump"
70
-
71
68
  desc "Retrieves the current schema version number"
72
69
  app_task "version"
73
70
 
@@ -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) if !%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 }
@@ -59,4 +59,10 @@ 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
62
68
  end
@@ -12,7 +12,7 @@ task about: :environment do
12
12
  end
13
13
 
14
14
  namespace :time do
15
- desc "List all time zones, list by two-letter country code (`rails time:zones[US]`), or list by UTC offset (`rails time:zones[-8]`)"
15
+ desc "List all time zones, list by two-letter country code (`bin/rails time:zones[US]`), or list by UTC offset (`bin/rails time:zones[-8]`)"
16
16
  task :zones, :country_or_offset do |t, args|
17
17
  zones, offset = ActiveSupport::TimeZone.all, nil
18
18
 
@@ -3,7 +3,7 @@
3
3
  # While global constants are bad, many 3rd party tools depend on this one (e.g
4
4
  # rspec-rails & cucumber-rails). So a deprecation warning is needed if we want
5
5
  # to remove it.
6
- STATS_DIRECTORIES = [
6
+ STATS_DIRECTORIES ||= [
7
7
  %w(Controllers app/controllers),
8
8
  %w(Helpers app/helpers),
9
9
  %w(Jobs app/jobs),
data/lib/rails/tasks.rb CHANGED
@@ -4,15 +4,11 @@ require "rake"
4
4
 
5
5
  # Load Rails Rakefile extensions
6
6
  %w(
7
- annotations
8
- dev
9
7
  framework
10
- initializers
11
8
  log
12
9
  middleware
13
10
  misc
14
11
  restart
15
- routes
16
12
  tmp
17
13
  yarn
18
14
  zeitwerk
@@ -1,5 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <html><head>
3
+ <title><%= @page_title %></title>
3
4
  <meta name="viewport" content="width=device-width" />
4
5
  <style type="text/css">
5
6
  html, body, iframe {
@@ -55,7 +55,7 @@
55
55
  <div class="container">
56
56
  <section>
57
57
  <p>
58
- <a href="http://rubyonrails.org">
58
+ <a href="https://rubyonrails.org">
59
59
  <img width="130" height="46" alt="Ruby on Rails" border="0" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA0MDAgMTQwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA0MDAgMTQwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZT4uYXtmaWxsOiNjMDA7fTwvc3R5bGU+DQo8dGl0bGU+cmFpbHMtbG9nbzwvdGl0bGU+DQo8Zz4NCgk8cGF0aCBjbGFzcz0iYSIgZD0iTTM0Ni42LDEyMS41djE4LjFjMCwwLDIzLjQsMCwzMi43LDBjNi43LDAsMTguMi00LjksMTguNi0xOC42YzAtMC42LDAtNi41LDAtN2MwLTExLjctOS42LTE4LjYtMTguNi0xOC42DQoJCWMtNC4yLDAtMTYuMywwLTE2LjMsMFY4N2wzMi4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uOS0xLjgtOC4zLTIuNC0xM0w5MSwxMTkuNnoiLz4NCjwvZz4NCjwvc3ZnPg0K" />
60
60
  </a>
61
61
  </p>
@@ -5,6 +5,7 @@ require "minitest"
5
5
 
6
6
  module Rails
7
7
  class TestUnitReporter < Minitest::StatisticsReporter
8
+ class_attribute :app_root
8
9
  class_attribute :executable, default: "rails test"
9
10
 
10
11
  def record(result)
@@ -79,7 +80,7 @@ module Rails
79
80
  end
80
81
 
81
82
  def app_root
82
- @app_root ||=
83
+ @app_root ||= self.class.app_root ||
83
84
  if defined?(ENGINE_ROOT)
84
85
  ENGINE_ROOT
85
86
  elsif Rails.respond_to?(:root)
@@ -44,8 +44,8 @@ module Rails
44
44
  def load_tests(argv)
45
45
  patterns = extract_filters(argv)
46
46
 
47
- tests = Rake::FileList[patterns.any? ? patterns : "test/**/*_test.rb"]
48
- tests.exclude("test/system/**/*") if patterns.empty?
47
+ tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
48
+ tests.exclude(default_test_exclude_glob) if patterns.empty?
49
49
 
50
50
  tests.to_a.each { |path| require File.expand_path(path) }
51
51
  end
@@ -62,6 +62,7 @@ module Rails
62
62
  def extract_filters(argv)
63
63
  # Extract absolute and relative paths but skip -n /.*/ regexp filters.
64
64
  argv.select { |arg| path_argument?(arg) && !regexp_filter?(arg) }.map do |path|
65
+ path = path.tr("\\", "/")
65
66
  case
66
67
  when /(:\d+)+$/.match?(path)
67
68
  file, *lines = path.split(":")
@@ -76,12 +77,20 @@ module Rails
76
77
  end
77
78
  end
78
79
 
80
+ def default_test_glob
81
+ ENV["DEFAULT_TEST"] || "test/**/*_test.rb"
82
+ end
83
+
84
+ def default_test_exclude_glob
85
+ ENV["DEFAULT_TEST_EXCLUDE"] || "test/{system,dummy}/**/*_test.rb"
86
+ end
87
+
79
88
  def regexp_filter?(arg)
80
89
  arg.start_with?("/") && arg.end_with?("/")
81
90
  end
82
91
 
83
92
  def path_argument?(arg)
84
- %r%^/?\w+/%.match?(arg)
93
+ %r"^[/\\]?\w+[/\\]".match?(arg)
85
94
  end
86
95
  end
87
96
  end
@@ -35,6 +35,12 @@ namespace :test do
35
35
  end
36
36
  end
37
37
 
38
+ desc "Runs all tests, including system tests"
39
+ task all: "test:prepare" do
40
+ $: << "test"
41
+ Rails::TestUnit::Runner.rake_run(["test/**/*_test.rb"])
42
+ end
43
+
38
44
  task generators: "test:prepare" do
39
45
  $: << "test"
40
46
  Rails::TestUnit::Runner.rake_run(["test/lib/generators"])
data/lib/rails.rb CHANGED
@@ -5,7 +5,6 @@ require "rails/ruby_version_check"
5
5
  require "pathname"
6
6
 
7
7
  require "active_support"
8
- require "active_support/dependencies/autoload"
9
8
  require "active_support/core_ext/kernel/reporting"
10
9
  require "active_support/core_ext/module/delegation"
11
10
  require "active_support/core_ext/array/extract_options"
@@ -71,14 +70,14 @@ module Rails
71
70
  # Rails.env.development? # => true
72
71
  # Rails.env.production? # => false
73
72
  def env
74
- @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development")
73
+ @_env ||= ActiveSupport::EnvironmentInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development")
75
74
  end
76
75
 
77
76
  # Sets the Rails environment.
78
77
  #
79
78
  # Rails.env = "staging" # => "staging"
80
79
  def env=(environment)
81
- @_env = ActiveSupport::StringInquirer.new(environment)
80
+ @_env = ActiveSupport::EnvironmentInquirer.new(environment)
82
81
  end
83
82
 
84
83
  # Returns all Rails groups for loading based on:
@@ -87,11 +86,9 @@ module Rails
87
86
  # * The environment variable RAILS_GROUPS;
88
87
  # * The optional envs given as argument and the hash with group dependencies;
89
88
  #
90
- # groups assets: [:development, :test]
91
- #
92
- # # Returns
93
- # # => [:default, "development", :assets] for Rails.env == "development"
94
- # # => [:default, "production"] for Rails.env == "production"
89
+ # Rails.groups assets: [:development, :test]
90
+ # # => [:default, "development", :assets] for Rails.env == "development"
91
+ # # => [:default, "production"] for Rails.env == "production"
95
92
  def groups(*groups)
96
93
  hash = groups.extract_options!
97
94
  env = Rails.env
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.0.6.1
4
+ version: 6.1.0.rc1
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-01-17 00:00:00.000000000 Z
11
+ date: 2020-11-02 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: 6.0.6.1
19
+ version: 6.1.0.rc1
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.0.6.1
26
+ version: 6.1.0.rc1
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.0.6.1
33
+ version: 6.1.0.rc1
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.0.6.1
40
+ version: 6.1.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,22 +56,16 @@ dependencies:
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 0.20.3
62
- - - "<"
59
+ - - "~>"
63
60
  - !ruby/object:Gem::Version
64
- version: '2.0'
61
+ version: '1.0'
65
62
  type: :runtime
66
63
  prerelease: false
67
64
  version_requirements: !ruby/object:Gem::Requirement
68
65
  requirements:
69
- - - ">="
66
+ - - "~>"
70
67
  - !ruby/object:Gem::Version
71
- version: 0.20.3
72
- - - "<"
73
- - !ruby/object:Gem::Version
74
- version: '2.0'
68
+ version: '1.0'
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: method_source
77
71
  requirement: !ruby/object:Gem::Requirement
@@ -92,14 +86,14 @@ dependencies:
92
86
  requirements:
93
87
  - - '='
94
88
  - !ruby/object:Gem::Version
95
- version: 6.0.6.1
89
+ version: 6.1.0.rc1
96
90
  type: :development
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
94
  - - '='
101
95
  - !ruby/object:Gem::Version
102
- version: 6.0.6.1
96
+ version: 6.1.0.rc1
103
97
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
104
98
  email: david@loudthinking.com
105
99
  executables:
@@ -144,6 +138,7 @@ files:
144
138
  - lib/rails/commands/console/console_command.rb
145
139
  - lib/rails/commands/credentials/USAGE
146
140
  - lib/rails/commands/credentials/credentials_command.rb
141
+ - lib/rails/commands/credentials/credentials_command/diffing.rb
147
142
  - lib/rails/commands/db/system/change/change_command.rb
148
143
  - lib/rails/commands/dbconsole/dbconsole_command.rb
149
144
  - lib/rails/commands/destroy/destroy_command.rb
@@ -228,13 +223,12 @@ files:
228
223
  - lib/rails/generators/rails/app/templates/bin/rails.tt
229
224
  - lib/rails/generators/rails/app/templates/bin/rake.tt
230
225
  - lib/rails/generators/rails/app/templates/bin/setup.tt
226
+ - lib/rails/generators/rails/app/templates/bin/spring.tt
231
227
  - lib/rails/generators/rails/app/templates/bin/yarn.tt
232
228
  - lib/rails/generators/rails/app/templates/config.ru.tt
233
229
  - lib/rails/generators/rails/app/templates/config/application.rb.tt
234
230
  - lib/rails/generators/rails/app/templates/config/boot.rb.tt
235
231
  - lib/rails/generators/rails/app/templates/config/cable.yml.tt
236
- - lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt
237
- - lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt
238
232
  - lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt
239
233
  - lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt
240
234
  - lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt
@@ -254,10 +248,11 @@ files:
254
248
  - lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt
255
249
  - lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt
256
250
  - lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt
251
+ - lib/rails/generators/rails/app/templates/config/initializers/feature_policy.rb.tt
257
252
  - lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt
258
253
  - lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt
259
254
  - lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb.tt
260
- - lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt
255
+ - lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt
261
256
  - lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
262
257
  - lib/rails/generators/rails/app/templates/config/locales/en.yml
263
258
  - lib/rails/generators/rails/app/templates/config/puma.rb.tt
@@ -265,6 +260,7 @@ files:
265
260
  - lib/rails/generators/rails/app/templates/config/spring.rb.tt
266
261
  - lib/rails/generators/rails/app/templates/config/storage.yml.tt
267
262
  - lib/rails/generators/rails/app/templates/db/seeds.rb.tt
263
+ - lib/rails/generators/rails/app/templates/gitattributes.tt
268
264
  - lib/rails/generators/rails/app/templates/gitignore.tt
269
265
  - lib/rails/generators/rails/app/templates/package.json.tt
270
266
  - lib/rails/generators/rails/app/templates/public/404.html
@@ -282,6 +278,9 @@ files:
282
278
  - lib/rails/generators/rails/assets/USAGE
283
279
  - lib/rails/generators/rails/assets/assets_generator.rb
284
280
  - lib/rails/generators/rails/assets/templates/stylesheet.css
281
+ - lib/rails/generators/rails/benchmark/USAGE
282
+ - lib/rails/generators/rails/benchmark/benchmark_generator.rb
283
+ - lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt
285
284
  - lib/rails/generators/rails/controller/USAGE
286
285
  - lib/rails/generators/rails/controller/controller_generator.rb
287
286
  - lib/rails/generators/rails/controller/templates/controller.rb.tt
@@ -326,7 +325,6 @@ files:
326
325
  - lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt
327
326
  - lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt
328
327
  - lib/rails/generators/rails/plugin/templates/lib/tasks/%namespaced_name%_tasks.rake.tt
329
- - lib/rails/generators/rails/plugin/templates/rails/application.rb.tt
330
328
  - lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt
331
329
  - lib/rails/generators/rails/plugin/templates/rails/dummy_manifest.js.tt
332
330
  - lib/rails/generators/rails/plugin/templates/rails/engine_manifest.js.tt
@@ -398,16 +396,12 @@ files:
398
396
  - lib/rails/secrets.rb
399
397
  - lib/rails/source_annotation_extractor.rb
400
398
  - lib/rails/tasks.rb
401
- - lib/rails/tasks/annotations.rake
402
- - lib/rails/tasks/dev.rake
403
399
  - lib/rails/tasks/engine.rake
404
400
  - lib/rails/tasks/framework.rake
405
- - lib/rails/tasks/initializers.rake
406
401
  - lib/rails/tasks/log.rake
407
402
  - lib/rails/tasks/middleware.rake
408
403
  - lib/rails/tasks/misc.rake
409
404
  - lib/rails/tasks/restart.rake
410
- - lib/rails/tasks/routes.rake
411
405
  - lib/rails/tasks/statistics.rake
412
406
  - lib/rails/tasks/tmp.rake
413
407
  - lib/rails/tasks/yarn.rake
@@ -432,12 +426,11 @@ licenses:
432
426
  - MIT
433
427
  metadata:
434
428
  bug_tracker_uri: https://github.com/rails/rails/issues
435
- changelog_uri: https://github.com/rails/rails/blob/v6.0.6.1/railties/CHANGELOG.md
436
- documentation_uri: https://api.rubyonrails.org/v6.0.6.1/
429
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.0.rc1/railties/CHANGELOG.md
430
+ documentation_uri: https://api.rubyonrails.org/v6.1.0.rc1/
437
431
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
438
- source_code_uri: https://github.com/rails/rails/tree/v6.0.6.1/railties
439
- rubygems_mfa_required: 'true'
440
- post_install_message:
432
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.0.rc1/railties
433
+ post_install_message:
441
434
  rdoc_options:
442
435
  - "--exclude"
443
436
  - "."
@@ -450,12 +443,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
450
443
  version: 2.5.0
451
444
  required_rubygems_version: !ruby/object:Gem::Requirement
452
445
  requirements:
453
- - - ">="
446
+ - - ">"
454
447
  - !ruby/object:Gem::Version
455
- version: '0'
448
+ version: 1.3.1
456
449
  requirements: []
457
- rubygems_version: 3.4.3
458
- signing_key:
450
+ rubygems_version: 3.1.4
451
+ signing_key:
459
452
  specification_version: 4
460
453
  summary: Tools for creating, working with, and running Rails applications.
461
454
  test_files: []
@@ -1,50 +0,0 @@
1
- # FrontBase versions 4.x
2
- #
3
- # Get the bindings:
4
- # gem install ruby-frontbase
5
- #
6
- # Configure Using Gemfile
7
- # gem 'ruby-frontbase'
8
- #
9
- default: &default
10
- adapter: frontbase
11
- pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
12
- host: localhost
13
- username: <%= app_name %>
14
- password: ''
15
-
16
- development:
17
- <<: *default
18
- database: <%= app_name %>_development
19
-
20
- # Warning: The database defined as "test" will be erased and
21
- # re-generated from your development database when you run "rake".
22
- # Do not set this db to the same as development or production.
23
- test:
24
- <<: *default
25
- database: <%= app_name %>_test
26
-
27
- # As with config/credentials.yml, you never want to store sensitive information,
28
- # like your database password, in your source code. If your source code is
29
- # ever seen by anyone, they now have access to your database.
30
- #
31
- # Instead, provide the password as a unix environment variable when you boot
32
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
33
- # for a full rundown on how to provide these environment variables in a
34
- # production deployment.
35
- #
36
- # On Heroku and other platform providers, you may have a full connection URL
37
- # available as an environment variable. For example:
38
- #
39
- # DATABASE_URL="frontbase://myuser:mypass@localhost/somedatabase"
40
- #
41
- # You can use this database configuration with:
42
- #
43
- # production:
44
- # url: <%%= ENV['DATABASE_URL'] %>
45
- #
46
- production:
47
- <<: *default
48
- database: <%= app_name %>_production
49
- username: <%= app_name %>
50
- password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>