railties 6.0.0.beta2 → 6.0.2.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +150 -7
  3. data/RDOC_MAIN.rdoc +3 -3
  4. data/README.rdoc +1 -1
  5. data/lib/rails/api/task.rb +1 -0
  6. data/lib/rails/application.rb +23 -5
  7. data/lib/rails/application/bootstrap.rb +2 -10
  8. data/lib/rails/application/configuration.rb +45 -1
  9. data/lib/rails/application/default_middleware_stack.rb +1 -0
  10. data/lib/rails/application/dummy_erb_compiler.rb +18 -0
  11. data/lib/rails/application/finisher.rb +44 -1
  12. data/lib/rails/autoloaders.rb +14 -2
  13. data/lib/rails/command/base.rb +4 -0
  14. data/lib/rails/command/environment_argument.rb +7 -4
  15. data/lib/rails/commands/console/console_command.rb +6 -0
  16. data/lib/rails/commands/credentials/USAGE +1 -1
  17. data/lib/rails/commands/credentials/credentials_command.rb +17 -3
  18. data/lib/rails/commands/dbconsole/dbconsole_command.rb +19 -7
  19. data/lib/rails/commands/dev/dev_command.rb +4 -2
  20. data/lib/rails/commands/encrypted/USAGE +28 -0
  21. data/lib/rails/commands/encrypted/encrypted_command.rb +1 -0
  22. data/lib/rails/commands/initializers/initializers_command.rb +7 -0
  23. data/lib/rails/commands/notes/notes_command.rb +1 -1
  24. data/lib/rails/commands/runner/runner_command.rb +7 -3
  25. data/lib/rails/commands/server/server_command.rb +8 -6
  26. data/lib/rails/engine.rb +41 -42
  27. data/lib/rails/engine/configuration.rb +3 -2
  28. data/lib/rails/gem_version.rb +2 -2
  29. data/lib/rails/generators.rb +2 -0
  30. data/lib/rails/generators/app_base.rb +5 -5
  31. data/lib/rails/generators/app_name.rb +2 -2
  32. data/lib/rails/generators/base.rb +4 -0
  33. data/lib/rails/generators/database.rb +1 -1
  34. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +6 -3
  35. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +8 -0
  36. data/lib/rails/generators/generated_attribute.rb +36 -10
  37. data/lib/rails/generators/named_base.rb +1 -1
  38. data/lib/rails/generators/rails/app/app_generator.rb +1 -0
  39. data/lib/rails/generators/rails/app/templates/Gemfile.tt +4 -4
  40. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +8 -0
  41. data/lib/rails/generators/rails/app/templates/bin/setup.tt +3 -2
  42. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +1 -1
  43. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
  44. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +2 -0
  45. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +2 -0
  46. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +10 -4
  47. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +3 -0
  48. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +12 -0
  49. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +3 -0
  50. data/lib/rails/generators/rails/app/templates/gitignore.tt +1 -0
  51. data/lib/rails/generators/rails/app/templates/package.json.tt +3 -3
  52. data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -1
  53. data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
  54. data/lib/rails/generators/rails/assets/assets_generator.rb +7 -0
  55. data/lib/rails/generators/rails/db/system/change/change_generator.rb +12 -2
  56. data/lib/rails/generators/rails/plugin/plugin_generator.rb +0 -15
  57. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +1 -0
  58. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +14 -0
  59. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -1
  60. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +1 -1
  61. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
  62. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +7 -2
  63. data/lib/rails/info.rb +1 -1
  64. data/lib/rails/mailers_controller.rb +6 -3
  65. data/lib/rails/source_annotation_extractor.rb +19 -6
  66. data/lib/rails/tasks.rb +1 -0
  67. data/lib/rails/tasks/zeitwerk.rake +66 -0
  68. metadata +18 -13
  69. data/lib/rails/generators/rails/app/templates/bin/update.tt +0 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a90a9035f3be11b2b2a4c4fa8a020b201755e135aaf581420eee30d622f9f6d7
4
- data.tar.gz: bcbfff6e2dedab7895b46c3befe8209ff0768d67dcc2047636f79883765cef5e
3
+ metadata.gz: e53c51805ad9598e809632f5a35694017eb3645b5336f995221397f9598cd286
4
+ data.tar.gz: 7b93225441e1614af60280d10e506ce4497a6cf7b356b1598c13fe3f7224d335
5
5
  SHA512:
6
- metadata.gz: e2fadeee30a37cd2b47d48fd3cce775c1351195446850888075d2b0540b9a2120fb939e24a5fc5121fe4d0a9188a7daf3c4383af9b9f111f3065a21a83b37544
7
- data.tar.gz: 7d5aec204ddc86f793f5dffb7b91b3e95c39e078cf5dd477e8ad0652550cad52be8f3ceada7e6507d612f9a5161a91756a59e2394cf4683f51d13365e2b178ab
6
+ metadata.gz: 0c191ad259fc9ba7231edbf23c1381a270972b3b337355079200b19a7ba2399c7801a0db92bb8c286130c6c9f3ef0b19840a5a8aef1f7a8cf58f086e0421fd99
7
+ data.tar.gz: b00314a37fd0c76357e5c5bf5cc1306bb146f8a7944b65ca1f56a4beda0b30a42a0c42219f3dc12411a585e87fb4bf34d79d3662045b74185de5a8000f3bf943
@@ -1,3 +1,144 @@
1
+ ## Rails 6.0.2.rc1 (November 27, 2019) ##
2
+
3
+ * Fix the collision check for the scaffold generator.
4
+
5
+ *Ryan Robeson*
6
+
7
+ * Configuration files for environments (`config/environments/*.rb`) are
8
+ now able to modify `autoload_paths`, `autoload_once_paths`, and
9
+ `eager_load_paths`.
10
+
11
+ *Allen Hsu* & *Xavier Noria*
12
+
13
+
14
+ ## Rails 6.0.1 (November 5, 2019) ##
15
+
16
+ * The `zeitwerk:check` Rake task reports files outside the app's root
17
+ directory, as in engines loaded from gems.
18
+
19
+ *Xavier Noria*
20
+
21
+ * Fixed a possible error when using the evented file update checker.
22
+
23
+ *Yuji Yaginuma*
24
+
25
+ * The sqlite3 database files created by the parallel testing feature are
26
+ included in the default `.gitignore` file for newly-generated apps.
27
+
28
+ *Yasuo Honda*
29
+
30
+ * `rails new` generates a `.keep` file in `tmp/pids`. This fixes starting
31
+ a server via `rackup` instead of `rails server`.
32
+
33
+ *Rafael Mendonça França*
34
+
35
+
36
+ ## Rails 6.0.0 (August 16, 2019) ##
37
+
38
+ * `Rails.autoloaders.log!` is a logging shortcut to get the activity of the
39
+ loaders printed to standard output. May be handy for troubleshooting.
40
+
41
+ *Xavier Noria*
42
+
43
+
44
+ ## Rails 6.0.0.rc2 (July 22, 2019) ##
45
+
46
+ * The new configuration point `config.add_autoload_paths_to_load_path` allows
47
+ users to opt-out from adding autoload paths to `$LOAD_PATH`. This flag is
48
+ `true` by default, but it is recommended to be set to `false` in `:zeitwerk`
49
+ mode early, in `config/application.rb`.
50
+
51
+ Zeitwerk uses only absolute paths internally, and applications running in
52
+ `:zeitwerk` mode do not need `require_dependency`, so models, controllers,
53
+ jobs, etc. do not need to be in `$LOAD_PATH`. Setting this to `false` saves
54
+ Ruby from checking these directories when resolving `require` calls with
55
+ relative paths, and saves Bootsnap work and RAM, since it does not need to
56
+ build an index for them.
57
+
58
+ *Xavier Noria*
59
+
60
+ ## Rails 6.0.0.rc1 (April 24, 2019) ##
61
+
62
+ * Applications upgrading to Rails 6 can run the command
63
+
64
+ ```
65
+ bin/rails zeitwerk:check
66
+ ```
67
+
68
+ to check if the project structure they were using with the classic
69
+ autoloader is compatible with `:zeitwerk` mode.
70
+
71
+ *Matilda Smeds* & *Xavier Noria*
72
+
73
+ * Allow loading seeds without ActiveJob.
74
+
75
+ Fixes #35782
76
+
77
+ *Jeremy Weathers*
78
+
79
+ * `null: false` is set in the migrations by default for column pointed by
80
+ `belongs_to` / `references` association generated by model generator.
81
+
82
+ Also deprecate passing {required} to the model generator.
83
+
84
+ *Prathamesh Sonpatki*
85
+
86
+ * New applications get `config.cache_classes = false` in `config/environments/test.rb`
87
+ unless `--skip-spring`.
88
+
89
+ *Xavier Noria*
90
+
91
+ * Autoloading during initialization is deprecated.
92
+
93
+ *Xavier Noria*
94
+
95
+ * Only force `:async` ActiveJob adapter to `:inline` during seeding.
96
+
97
+ *BatedUrGonnaDie*
98
+
99
+ * The `connection` option of `rails dbconsole` command is deprecated in
100
+ favor of `database` option.
101
+
102
+ *Yuji Yaginuma*
103
+
104
+ * Replace `chromedriver-helper` gem with `webdrivers` in default Gemfile.
105
+ `chromedriver-helper` is deprecated as of March 31, 2019 and won't
106
+ receive any further updates.
107
+
108
+ *Guillermo Iguaran‮*
109
+
110
+ * Applications running in `:zeitwerk` mode that use `bootsnap` need
111
+ to upgrade `bootsnap` to at least 1.4.2.
112
+
113
+ *Xavier Noria*
114
+
115
+ * Add `config.disable_sandbox` option to Rails console.
116
+
117
+ This setting will disable `rails console --sandbox` mode, preventing
118
+ developer from accidentally starting a sandbox console,
119
+ which when left inactive, can cause the database server to run out of memory.
120
+
121
+ *Prem Sichanugrist*
122
+
123
+ * Add `-e/--environment` option to `rails initializers`.
124
+
125
+ *Yuji Yaginuma*
126
+
127
+
128
+ ## Rails 6.0.0.beta3 (March 11, 2019) ##
129
+
130
+ * Generate random development secrets
131
+
132
+ A random development secret is now generated to tmp/development_secret.txt
133
+
134
+ This avoids an issue where development mode servers were vulnerable to
135
+ remote code execution.
136
+
137
+ Fixes CVE-2019-5420
138
+
139
+ *Eileen M. Uchitelle*, *Aaron Patterson*, *John Hawthorn*
140
+
141
+
1
142
  ## Rails 6.0.0.beta2 (February 25, 2019) ##
2
143
 
3
144
  * Fix non-symbol access to nested hashes returned from `Rails::Application.config_for`
@@ -44,7 +185,9 @@
44
185
  gsub Gemfile
45
186
  ```
46
187
 
47
- The change command copies a template `config/database.yml` with the target database adapter into your app, and replaces your database gem with the target database gem.
188
+ The change command copies a template `config/database.yml` with
189
+ the target database adapter into your app, and replaces your database gem
190
+ with the target database gem.
48
191
 
49
192
  *Gannon McGibbon*
50
193
 
@@ -68,9 +211,9 @@
68
211
 
69
212
  *George Claghorn*
70
213
 
71
- * Introduce guard against DNS rebinding attacks
214
+ * Introduce guard against DNS rebinding attacks.
72
215
 
73
- The `ActionDispatch::HostAuthorization` is a new middleware that prevent
216
+ The `ActionDispatch::HostAuthorization` is a new middleware that prevents
74
217
  against DNS rebinding and other `Host` header attacks. It is included in
75
218
  the development environment by default with the following configuration:
76
219
 
@@ -88,7 +231,7 @@
88
231
  Rails.application.config.hosts << "product.com"
89
232
 
90
233
  The host of a request is checked against the `hosts` entries with the case
91
- operator (`#===`), which lets `hosts` support entries of type `RegExp`,
234
+ operator (`#===`), which lets `hosts` support entries of type `Regexp`,
92
235
  `Proc` and `IPAddr` to name a few. Here is an example with a regexp.
93
236
 
94
237
  # Allow requests from subdomains like `www.product.com` and
@@ -178,7 +321,7 @@
178
321
  The encryption key can be in `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key`.
179
322
 
180
323
  Environment credentials overrides can be edited with `rails credentials:edit --environment production`.
181
- If no override is setup for the passed environment, it will be created.
324
+ If no override is set up for the passed environment, it will be created.
182
325
 
183
326
  Additionally, the default lookup paths can be overwritten with these configs:
184
327
 
@@ -268,9 +411,9 @@
268
411
 
269
412
  *Jose Luis Duran*
270
413
 
271
- * Deprecate support for using the `HOST` environment to specify the server IP.
414
+ * Deprecate support for using the `HOST` environment variable to specify the server IP.
272
415
 
273
- The `BINDING` environment should be used instead.
416
+ The `BINDING` environment variable should be used instead.
274
417
 
275
418
  Fixes #29516.
276
419
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  \Rails is a web-application framework that includes everything needed to
6
6
  create database-backed web applications according to the
7
- {Model-View-Controller (MVC)}[http://en.wikipedia.org/wiki/Model-view-controller]
7
+ {Model-View-Controller (MVC)}[https://en.wikipedia.org/wiki/Model-view-controller]
8
8
  pattern.
9
9
 
10
10
  Understanding the MVC pattern is key to understanding \Rails. MVC divides your
@@ -79,7 +79,7 @@ and may also be used independently outside \Rails.
79
79
  * The \README file created within your application.
80
80
  * {Getting Started with \Rails}[https://guides.rubyonrails.org/getting_started.html].
81
81
  * {Ruby on \Rails Guides}[https://guides.rubyonrails.org].
82
- * {The API Documentation}[http://api.rubyonrails.org].
82
+ * {The API Documentation}[https://api.rubyonrails.org].
83
83
  * {Ruby on \Rails Tutorial}[https://www.railstutorial.org/book].
84
84
 
85
85
  == Contributing
@@ -88,7 +88,7 @@ We encourage you to contribute to Ruby on \Rails! Please check out the
88
88
  {Contributing to Ruby on \Rails guide}[https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how to proceed. {Join us!}[http://contributors.rubyonrails.org]
89
89
 
90
90
  Trying to report a possible security vulnerability in \Rails? Please
91
- check out our {security policy}[http://rubyonrails.org/security/] for
91
+ check out our {security policy}[https://rubyonrails.org/security/] for
92
92
  guidelines about how to proceed.
93
93
 
94
94
  Everyone interacting in \Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the \Rails {code of conduct}[http://rubyonrails.org/conduct/].
@@ -29,7 +29,7 @@ Railties is released under the MIT license:
29
29
 
30
30
  API documentation is at
31
31
 
32
- * http://api.rubyonrails.org
32
+ * https://api.rubyonrails.org
33
33
 
34
34
  Bug reports can be filed for the Ruby on Rails project here:
35
35
 
@@ -18,6 +18,7 @@ module Rails
18
18
  include: %w(
19
19
  README.rdoc
20
20
  lib/active_record/**/*.rb
21
+ lib/arel.rb
21
22
  )
22
23
  },
23
24
 
@@ -270,7 +270,8 @@ module Rails
270
270
  "action_dispatch.use_cookies_with_metadata" => config.action_dispatch.use_cookies_with_metadata,
271
271
  "action_dispatch.content_security_policy" => config.content_security_policy,
272
272
  "action_dispatch.content_security_policy_report_only" => config.content_security_policy_report_only,
273
- "action_dispatch.content_security_policy_nonce_generator" => config.content_security_policy_nonce_generator
273
+ "action_dispatch.content_security_policy_nonce_generator" => config.content_security_policy_nonce_generator,
274
+ "action_dispatch.content_security_policy_nonce_directives" => config.content_security_policy_nonce_directives
274
275
  )
275
276
  end
276
277
  end
@@ -349,7 +350,7 @@ module Rails
349
350
  files, dirs = config.watchable_files.dup, config.watchable_dirs.dup
350
351
 
351
352
  ActiveSupport::Dependencies.autoload_paths.each do |path|
352
- dirs[path.to_s] = [:rb]
353
+ File.file?(path) ? files << path.to_s : dirs[path.to_s] = [:rb]
353
354
  end
354
355
 
355
356
  [files, dirs]
@@ -409,14 +410,15 @@ module Rails
409
410
  # The secret_key_base is used as the input secret to the application's key generator, which in turn
410
411
  # is used to create all MessageVerifiers/MessageEncryptors, including the ones that sign and encrypt cookies.
411
412
  #
412
- # In test and development, this is simply derived as a MD5 hash of the application's name.
413
+ # In development and test, this is randomly generated and stored in a
414
+ # temporary file in <tt>tmp/development_secret.txt</tt>.
413
415
  #
414
416
  # In all other environments, we look for it first in ENV["SECRET_KEY_BASE"],
415
417
  # then credentials.secret_key_base, and finally secrets.secret_key_base. For most applications,
416
418
  # the correct place to store it is in the encrypted credentials file.
417
419
  def secret_key_base
418
- if Rails.env.test? || Rails.env.development?
419
- secrets.secret_key_base || Digest::MD5.hexdigest(self.class.name)
420
+ if Rails.env.development? || Rails.env.test?
421
+ secrets.secret_key_base ||= generate_development_secret
420
422
  else
421
423
  validate_secret_key_base(
422
424
  ENV["SECRET_KEY_BASE"] || credentials.secret_key_base || secrets.secret_key_base
@@ -581,6 +583,22 @@ module Rails
581
583
 
582
584
  private
583
585
 
586
+ def generate_development_secret
587
+ if secrets.secret_key_base.nil?
588
+ key_file = Rails.root.join("tmp/development_secret.txt")
589
+
590
+ if !File.exist?(key_file)
591
+ random_key = SecureRandom.hex(64)
592
+ FileUtils.mkdir_p(key_file.dirname)
593
+ File.binwrite(key_file, random_key)
594
+ end
595
+
596
+ secrets.secret_key_base = File.binread(key_file)
597
+ end
598
+
599
+ secrets.secret_key_base
600
+ end
601
+
584
602
  def build_request(env)
585
603
  req = super
586
604
  env["ORIGINAL_FULLPATH"] = req.fullpath
@@ -34,20 +34,12 @@ INFO
34
34
  # Initialize the logger early in the stack in case we need to log some deprecation.
35
35
  initializer :initialize_logger, group: :all do
36
36
  Rails.logger ||= config.logger || begin
37
- path = config.paths["log"].first
38
- unless File.exist? File.dirname path
39
- FileUtils.mkdir_p File.dirname path
40
- end
41
-
42
- f = File.open path, "a"
43
- f.binmode
44
- f.sync = config.autoflush_log # if true make sure every write flushes
45
-
46
- logger = ActiveSupport::Logger.new f
37
+ logger = ActiveSupport::Logger.new(config.default_log_file)
47
38
  logger.formatter = config.log_formatter
48
39
  logger = ActiveSupport::TaggedLogging.new(logger)
49
40
  logger
50
41
  rescue StandardError
42
+ path = config.paths["log"].first
51
43
  logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDERR))
52
44
  logger.level = ActiveSupport::Logger::WARN
53
45
  logger.warn(
@@ -18,7 +18,8 @@ module Rails
18
18
  :session_options, :time_zone, :reload_classes_only_on_change,
19
19
  :beginning_of_week, :filter_redirect, :x, :enable_dependency_loading,
20
20
  :read_encrypted_secrets, :log_level, :content_security_policy_report_only,
21
- :content_security_policy_nonce_generator, :require_master_key, :credentials
21
+ :content_security_policy_nonce_generator, :content_security_policy_nonce_directives,
22
+ :require_master_key, :credentials, :disable_sandbox, :add_autoload_paths_to_load_path
22
23
 
23
24
  attr_reader :encoding, :api_only, :loaded_config_version, :autoloader
24
25
 
@@ -59,14 +60,18 @@ module Rails
59
60
  @content_security_policy = nil
60
61
  @content_security_policy_report_only = false
61
62
  @content_security_policy_nonce_generator = nil
63
+ @content_security_policy_nonce_directives = nil
62
64
  @require_master_key = false
63
65
  @loaded_config_version = nil
64
66
  @credentials = ActiveSupport::OrderedOptions.new
65
67
  @credentials.content_path = default_credentials_content_path
66
68
  @credentials.key_path = default_credentials_key_path
67
69
  @autoloader = :classic
70
+ @disable_sandbox = false
71
+ @add_autoload_paths_to_load_path = true
68
72
  end
69
73
 
74
+ # Loads default configurations. See {the result of the method for each version}[https://guides.rubyonrails.org/configuring.html#results-of-config-load-defaults].
70
75
  def load_defaults(target_version)
71
76
  case target_version.to_s
72
77
  when "5.0"
@@ -126,6 +131,7 @@ module Rails
126
131
 
127
132
  if respond_to?(:action_dispatch)
128
133
  action_dispatch.use_cookies_with_metadata = true
134
+ action_dispatch.return_only_media_type_on_content_type = false
129
135
  end
130
136
 
131
137
  if respond_to?(:action_mailer)
@@ -139,6 +145,12 @@ module Rails
139
145
  if respond_to?(:active_storage)
140
146
  active_storage.queues.analysis = :active_storage_analysis
141
147
  active_storage.queues.purge = :active_storage_purge
148
+
149
+ active_storage.replace_on_assign_to_many = true
150
+ end
151
+
152
+ if respond_to?(:active_record)
153
+ active_record.collection_cache_versioning = true
142
154
  end
143
155
  else
144
156
  raise "Unknown version #{target_version.to_s.inspect}"
@@ -184,6 +196,26 @@ module Rails
184
196
  end
185
197
  end
186
198
 
199
+ # Load the database YAML without evaluating ERB. This allows us to
200
+ # create the rake tasks for multiple databases without filling in the
201
+ # configuration values or loading the environment. Do not use this
202
+ # method.
203
+ #
204
+ # This uses a DummyERB custom compiler so YAML can ignore the ERB
205
+ # tags and load the database.yml for the rake tasks.
206
+ def load_database_yaml # :nodoc:
207
+ if path = paths["config/database"].existent.first
208
+ require "rails/application/dummy_erb_compiler"
209
+
210
+ yaml = Pathname.new(path)
211
+ erb = DummyERB.new(yaml.read)
212
+
213
+ YAML.load(erb.result) || {}
214
+ else
215
+ {}
216
+ end
217
+ end
218
+
187
219
  # Loads and returns the entire raw configuration of database from
188
220
  # values stored in <tt>config/database.yml</tt>.
189
221
  def database_configuration
@@ -282,6 +314,18 @@ module Rails
282
314
  end
283
315
  end
284
316
 
317
+ def default_log_file
318
+ path = paths["log"].first
319
+ unless File.exist? File.dirname path
320
+ FileUtils.mkdir_p File.dirname path
321
+ end
322
+
323
+ f = File.open path, "a"
324
+ f.binmode
325
+ f.sync = autoflush_log # if true make sure every write flushes
326
+ f
327
+ end
328
+
285
329
  class Custom #:nodoc:
286
330
  def initialize
287
331
  @configurations = Hash.new
@@ -49,6 +49,7 @@ module Rails
49
49
  middleware.use ::Rails::Rack::Logger, config.log_tags
50
50
  middleware.use ::ActionDispatch::ShowExceptions, show_exceptions_app
51
51
  middleware.use ::ActionDispatch::DebugExceptions, app, config.debug_exception_response_format
52
+ middleware.use ::ActionDispatch::ActionableExceptions
52
53
 
53
54
  unless config.cache_classes
54
55
  middleware.use ::ActionDispatch::Reloader, app.reloader
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # These classes are used to strip out the ERB configuration
4
+ # values so we can evaluate the database.yml without evaluating
5
+ # the ERB values.
6
+ class DummyERB < ERB # :nodoc:
7
+ def make_compiler(trim_mode)
8
+ DummyCompiler.new trim_mode
9
+ end
10
+ end
11
+
12
+ class DummyCompiler < ERB::Compiler # :nodoc:
13
+ def compile_content(stag, out)
14
+ if stag == "<%="
15
+ out.push "_erbout << ''"
16
+ end
17
+ end
18
+ end