railties 5.1.0.rc1 → 5.1.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -5
  3. data/lib/rails/application.rb +3 -1
  4. data/lib/rails/application/bootstrap.rb +0 -1
  5. data/lib/rails/application/configuration.rb +2 -7
  6. data/lib/rails/code_statistics.rb +2 -1
  7. data/lib/rails/commands/destroy/destroy_command.rb +3 -0
  8. data/lib/rails/commands/runner/runner_command.rb +3 -2
  9. data/lib/rails/commands/server/server_command.rb +4 -2
  10. data/lib/rails/gem_version.rb +1 -1
  11. data/lib/rails/generators/app_base.rb +7 -10
  12. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb +8 -8
  13. data/lib/rails/generators/named_base.rb +4 -0
  14. data/lib/rails/generators/rails/app/app_generator.rb +35 -6
  15. data/lib/rails/generators/rails/app/templates/Gemfile +1 -1
  16. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +1 -4
  17. data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css +1 -1
  18. data/lib/rails/generators/rails/app/templates/bin/setup.tt +1 -1
  19. data/lib/rails/generators/rails/app/templates/bin/update.tt +1 -0
  20. data/lib/rails/generators/rails/app/templates/config/application.rb +4 -0
  21. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_1.rb.tt +3 -0
  22. data/lib/rails/generators/rails/app/templates/config/secrets.yml +2 -2
  23. data/lib/rails/generators/rails/app/templates/public/404.html +6 -6
  24. data/lib/rails/generators/rails/app/templates/public/422.html +6 -6
  25. data/lib/rails/generators/rails/app/templates/public/500.html +6 -6
  26. data/lib/rails/paths.rb +8 -1
  27. data/lib/rails/secrets.rb +2 -8
  28. data/lib/rails/tasks/framework.rake +1 -1
  29. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6895d9df1a4cccea1127fb2713f7f16d50526088
4
- data.tar.gz: 4fe4884d5c19e294acfb03223c2f7306994ca3c3
3
+ metadata.gz: a6ecf54ff57387656250337a743947b5271bf35b
4
+ data.tar.gz: d7a2588e7d7bde11603c086948b7e26e9e480628
5
5
  SHA512:
6
- metadata.gz: 0dd8f119fd87746234d6e55a2f83c17b0b0b67da5f023e381f48fcb4005bdb88e3689d27013011ed0e341d4eae4081233408622cbbc20a88a6bb38eb76e12504
7
- data.tar.gz: 8bd6dc9bdd29b17ba24dee55fbcc0920d1ec48b4f97a434062c364351292ff55acb9c8954818190ab3914b8a0bed680c0635afe1f2cc03dcaabd0950009db568
6
+ metadata.gz: 2ac43ff8d469247946bb5b28bef288e0bf7689338c5ae28f244aa7e93c0f467d3f5c2fe9de579aae1b19b6cad2b5efb0d5ba89e4e4b09ecdc49ef1c57770be97
7
+ data.tar.gz: fcae7e8678c20e6abe4d8614fb0f571fbd6b459cba4eb26b6dd31511949467596609b2739684df4c5a51a04216c4cad60ea0b10632a0d41c5ff77971dc051d64
data/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## Rails 5.1.0.rc2 (April 20, 2017) ##
2
+
3
+ * Namespace error pages' CSS selectors to stop the styles from bleeding into other pages
4
+ when using Turbolinks.
5
+
6
+ *Jan Krutisch*
7
+
8
+ * Raise a error when using a bad symlink
9
+
10
+ Previously bad symlinks (where the link destination doesn't exist)
11
+ would be silent ignored and lead to hard to diagnose problems as
12
+ the non-existence isn't readily apparent.
13
+
14
+ *Richard Schneeman*
15
+
16
+ * Remove -j (--javascript) option from `rails new` command.
17
+
18
+ *claudiob*
19
+
20
+ * Specify form field ids when generating a scaffold.
21
+
22
+ This makes sure that the labels are linked up with the fields. The
23
+ regression was introduced when the template was switched to
24
+ `form_with`.
25
+
26
+ *Yves Senn*
27
+
28
+
1
29
  ## Rails 5.1.0.rc1 (March 20, 2017) ##
2
30
 
3
31
  * Add `app:update` task to engines.
@@ -189,11 +217,6 @@
189
217
 
190
218
  *Rafael Mendonça França*
191
219
 
192
- * Default `config.assets.quiet = true` in the development environment. Suppress
193
- logging of assets requests by default.
194
-
195
- *Kevin McPhillips*
196
-
197
220
  * Ensure `/rails/info` routes match in development for apps with a catch-all globbing route.
198
221
 
199
222
  *Nicholas Firth-McCoy*
@@ -386,7 +386,9 @@ module Rails
386
386
  def secrets
387
387
  @secrets ||= begin
388
388
  secrets = ActiveSupport::OrderedOptions.new
389
- secrets.merge! Rails::Secrets.parse(config.paths["config/secrets"].existent, env: Rails.env)
389
+ files = config.paths["config/secrets"].existent
390
+ files = files.reject { |path| path.end_with?(".enc") } unless config.read_encrypted_secrets
391
+ secrets.merge! Rails::Secrets.parse(files, env: Rails.env)
390
392
 
391
393
  # Fallback to config.secret_key_base if secrets.secret_key_base isn't set
392
394
  secrets.secret_key_base ||= config.secret_key_base
@@ -81,7 +81,6 @@ INFO
81
81
 
82
82
  initializer :set_secrets_root, group: :all do
83
83
  Rails::Secrets.root = root
84
- Rails::Secrets.read_encrypted_secrets = config.read_encrypted_secrets
85
84
  end
86
85
  end
87
86
  end
@@ -14,9 +14,8 @@ module Rails
14
14
  :ssl_options, :public_file_server,
15
15
  :session_options, :time_zone, :reload_classes_only_on_change,
16
16
  :beginning_of_week, :filter_redirect, :x, :enable_dependency_loading,
17
- :read_encrypted_secrets
17
+ :read_encrypted_secrets, :log_level
18
18
 
19
- attr_writer :log_level
20
19
  attr_reader :encoding, :api_only
21
20
 
22
21
  def initialize(*)
@@ -35,7 +34,7 @@ module Rails
35
34
  @session_store = nil
36
35
  @time_zone = "UTC"
37
36
  @beginning_of_week = :monday
38
- @log_level = nil
37
+ @log_level = :debug
39
38
  @generators = app_generators
40
39
  @cache_store = [ :file_store, "#{root}/tmp/cache/" ]
41
40
  @railties_order = [:all]
@@ -149,10 +148,6 @@ module Rails
149
148
  raise e, "Cannot load `Rails.application.database_configuration`:\n#{e.message}", e.backtrace
150
149
  end
151
150
 
152
- def log_level
153
- @log_level ||= (Rails.env.production? ? :info : :debug)
154
- end
155
-
156
151
  def colorize_logging
157
152
  ActiveSupport::LogSubscriber.colorize_logging
158
153
  end
@@ -7,7 +7,8 @@ class CodeStatistics #:nodoc:
7
7
  "Model tests",
8
8
  "Mailer tests",
9
9
  "Job tests",
10
- "Integration tests"]
10
+ "Integration tests",
11
+ "System tests"]
11
12
 
12
13
  HEADERS = { lines: " Lines", code_lines: " LOC", classes: "Classes", methods: "Methods" }
13
14
 
@@ -5,6 +5,9 @@ module Rails
5
5
  class DestroyCommand < Base # :nodoc:
6
6
  no_commands do
7
7
  def help
8
+ require_application_and_environment!
9
+ load_generators
10
+
8
11
  Rails::Generators.help self.class.command_name
9
12
  end
10
13
  end
@@ -16,7 +16,7 @@ module Rails
16
16
  "#{super} [<'Some.ruby(code)'> | <filename.rb>]"
17
17
  end
18
18
 
19
- def perform(code_or_file = nil, *file_argv)
19
+ def perform(code_or_file = nil, *command_argv)
20
20
  unless code_or_file
21
21
  help
22
22
  exit 1
@@ -27,9 +27,10 @@ module Rails
27
27
  require_application_and_environment!
28
28
  Rails.application.load_runner
29
29
 
30
+ ARGV.replace(command_argv)
31
+
30
32
  if File.exist?(code_or_file)
31
33
  $0 = code_or_file
32
- ARGV.replace(file_argv)
33
34
  Kernel.load code_or_file
34
35
  else
35
36
  begin
@@ -188,10 +188,12 @@ module Rails
188
188
  end
189
189
 
190
190
  def host
191
- unless (default_host = options[:binding])
191
+ if options[:binding]
192
+ options[:binding]
193
+ else
192
194
  default_host = environment == "development" ? "localhost" : "0.0.0.0"
195
+ ENV.fetch("HOST", default_host)
193
196
  end
194
- ENV.fetch("HOST", default_host)
195
197
  end
196
198
 
197
199
  def environment
@@ -8,7 +8,7 @@ module Rails
8
8
  MAJOR = 5
9
9
  MINOR = 1
10
10
  TINY = 0
11
- PRE = "rc1"
11
+ PRE = "rc2"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -13,6 +13,7 @@ module Rails
13
13
  DATABASES = %w( mysql postgresql sqlite3 oracle frontbase ibm_db sqlserver )
14
14
  JDBC_DATABASES = %w( jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc )
15
15
  DATABASES.concat(JDBC_DATABASES)
16
+ WEBPACKS = %w( react vue angular )
16
17
 
17
18
  attr_accessor :rails_template
18
19
  add_shebang_option!
@@ -30,11 +31,8 @@ module Rails
30
31
  class_option :database, type: :string, aliases: "-d", default: "sqlite3",
31
32
  desc: "Preconfigure for selected database (options: #{DATABASES.join('/')})"
32
33
 
33
- class_option :javascript, type: :string, aliases: "-j",
34
- desc: "Preconfigure for selected JavaScript library"
35
-
36
34
  class_option :webpack, type: :string, default: nil,
37
- desc: "Preconfigure for app-like JavaScript with Webpack"
35
+ desc: "Preconfigure for app-like JavaScript with Webpack (options: #{WEBPACKS.join('/')})"
38
36
 
39
37
  class_option :skip_yarn, type: :boolean, default: false,
40
38
  desc: "Don't use Yarn for managing JavaScript dependencies"
@@ -305,7 +303,7 @@ module Rails
305
303
  return [] if options[:skip_sprockets]
306
304
 
307
305
  gems = []
308
- gems << GemfileEntry.github("sass-rails", "rails/sass-rails", nil,
306
+ gems << GemfileEntry.version("sass-rails", "~> 5.0",
309
307
  "Use SCSS for stylesheets")
310
308
 
311
309
  if !options[:skip_javascript]
@@ -340,11 +338,6 @@ module Rails
340
338
  gems = [javascript_runtime_gemfile_entry]
341
339
  gems << coffee_gemfile_entry unless options[:skip_coffee]
342
340
 
343
- if options[:javascript]
344
- gems << GemfileEntry.version("#{options[:javascript]}-rails", nil,
345
- "Use #{options[:javascript]} as the JavaScript library")
346
- end
347
-
348
341
  unless options[:skip_turbolinks]
349
342
  gems << GemfileEntry.version("turbolinks", "~> 5",
350
343
  "Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks")
@@ -411,6 +404,10 @@ module Rails
411
404
  !options[:skip_spring] && !options.dev? && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin")
412
405
  end
413
406
 
407
+ def depends_on_system_test?
408
+ !(options[:skip_system_test] || options[:skip_test] || options[:api])
409
+ end
410
+
414
411
  def depend_on_listen?
415
412
  !options[:skip_listen] && os_supports_listen_out_of_the_box?
416
413
  end
@@ -1,4 +1,4 @@
1
- <%%= form_with(model: <%= singular_table_name %>, local: true) do |f| %>
1
+ <%%= form_with(model: <%= singular_table_name %>, local: true) do |form| %>
2
2
  <%% if <%= singular_table_name %>.errors.any? %>
3
3
  <div id="error_explanation">
4
4
  <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
@@ -14,21 +14,21 @@
14
14
  <% attributes.each do |attribute| -%>
15
15
  <div class="field">
16
16
  <% if attribute.password_digest? -%>
17
- <%%= f.label :password %>
18
- <%%= f.password_field :password %>
17
+ <%%= form.label :password %>
18
+ <%%= form.password_field :password, id: :<%= field_id(:password) %> %>
19
19
  </div>
20
20
 
21
21
  <div class="field">
22
- <%%= f.label :password_confirmation %>
23
- <%%= f.password_field :password_confirmation %>
22
+ <%%= form.label :password_confirmation %>
23
+ <%%= form.password_field :password_confirmation, id: :<%= field_id(:password_confirmation) %> %>
24
24
  <% else -%>
25
- <%%= f.label :<%= attribute.column_name %> %>
26
- <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %> %>
25
+ <%%= form.label :<%= attribute.column_name %> %>
26
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, id: :<%= field_id(attribute.column_name) %> %>
27
27
  <% end -%>
28
28
  </div>
29
29
 
30
30
  <% end -%>
31
31
  <div class="actions">
32
- <%%= f.submit %>
32
+ <%%= form.submit %>
33
33
  </div>
34
34
  <%% end %>
@@ -149,6 +149,10 @@ module Rails
149
149
  "new_#{singular_table_name}_url"
150
150
  end
151
151
 
152
+ def field_id(attribute_name)
153
+ [singular_table_name, attribute_name].join("_")
154
+ end
155
+
152
156
  def singular_table_name # :doc:
153
157
  @singular_table_name ||= (pluralize_table_names? ? table_name.singularize : table_name)
154
158
  end
@@ -84,6 +84,16 @@ module Rails
84
84
  chmod "bin", 0755 & ~File.umask, verbose: false
85
85
  end
86
86
 
87
+ def bin_when_updating
88
+ bin_yarn_exist = File.exist?("bin/yarn")
89
+
90
+ bin
91
+
92
+ if options[:api] && !bin_yarn_exist
93
+ remove_file "bin/yarn"
94
+ end
95
+ end
96
+
87
97
  def config
88
98
  empty_directory "config"
89
99
 
@@ -106,11 +116,11 @@ module Rails
106
116
  cookie_serializer_config_exist = File.exist?("config/initializers/cookies_serializer.rb")
107
117
  action_cable_config_exist = File.exist?("config/cable.yml")
108
118
  rack_cors_config_exist = File.exist?("config/initializers/cors.rb")
119
+ assets_config_exist = File.exist?("config/initializers/assets.rb")
120
+ new_framework_defaults_5_1_exist = File.exist?("config/initializers/new_framework_defaults_5_1.rb")
109
121
 
110
122
  config
111
123
 
112
- gsub_file "config/environments/development.rb", /^(\s+)config\.file_watcher/, '\1# config.file_watcher'
113
-
114
124
  unless cookie_serializer_config_exist
115
125
  gsub_file "config/initializers/cookies_serializer.rb", /json(?!,)/, "marshal"
116
126
  end
@@ -122,6 +132,22 @@ module Rails
122
132
  unless rack_cors_config_exist
123
133
  remove_file "config/initializers/cors.rb"
124
134
  end
135
+
136
+ if options[:api]
137
+ unless cookie_serializer_config_exist
138
+ remove_file "config/initializers/cookies_serializer.rb"
139
+ end
140
+
141
+ unless assets_config_exist
142
+ remove_file "config/initializers/assets.rb"
143
+ end
144
+
145
+ # Sprockets owns the only new default for 5.1:
146
+ # In API-only Applications, we don't want the file.
147
+ unless new_framework_defaults_5_1_exist
148
+ remove_file "config/initializers/new_framework_defaults_5_1.rb"
149
+ end
150
+ end
125
151
  end
126
152
 
127
153
  def database_yml
@@ -232,6 +258,11 @@ module Rails
232
258
  build(:bin)
233
259
  end
234
260
 
261
+ def update_bin_files
262
+ build(:bin_when_updating)
263
+ end
264
+ remove_task :update_bin_files
265
+
235
266
  def create_config_files
236
267
  build(:config)
237
268
  end
@@ -277,7 +308,7 @@ module Rails
277
308
  end
278
309
 
279
310
  def create_system_test_files
280
- build(:system_test) unless options[:skip_system_test] || options[:skip_test] || options[:api]
311
+ build(:system_test) if depends_on_system_test?
281
312
  end
282
313
 
283
314
  def create_tmp_files
@@ -372,9 +403,7 @@ module Rails
372
403
  end
373
404
 
374
405
  def delete_new_framework_defaults
375
- # Sprockets owns the only new default for 5.1: if it's disabled,
376
- # we don't want the file.
377
- unless options[:update] && !options[:skip_sprockets]
406
+ unless options[:update]
378
407
  remove_file "config/initializers/new_framework_defaults_5_1.rb"
379
408
  end
380
409
  end
@@ -32,7 +32,7 @@ end
32
32
  group :development, :test do
33
33
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
34
34
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
35
- <%- unless options.skip_system_test? || options.api? -%>
35
+ <%- if depends_on_system_test? -%>
36
36
  # Adds support for Capybara system testing and selenium driver
37
37
  gem 'capybara', '~> 2.13.0'
38
38
  gem 'selenium-webdriver'
@@ -1,7 +1,7 @@
1
1
  // This is a manifest file that'll be compiled into application.js, which will include all the files
2
2
  // listed below.
3
3
  //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
5
5
  // vendor/assets/javascripts directory can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
@@ -11,9 +11,6 @@
11
11
  // about supported directives.
12
12
  //
13
13
  <% unless options[:skip_javascript] -%>
14
- <% if options[:javascript] -%>
15
- //= require <%= options[:javascript] %>
16
- <% end -%>
17
14
  //= require rails-ujs
18
15
  <% unless options[:skip_turbolinks] -%>
19
16
  //= require turbolinks
@@ -2,7 +2,7 @@
2
2
  * This is a manifest file that'll be compiled into application.css, which will include all the files
3
3
  * listed below.
4
4
  *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
6
  * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
7
  *
8
8
  * You're free to add application-wide styles to this file and they'll appear at the bottom of the
@@ -19,9 +19,9 @@ chdir APP_ROOT do
19
19
  <% unless options[:skip_yarn] %>
20
20
  # Install JavaScript dependencies if using Yarn
21
21
  # system('bin/yarn')
22
-
23
22
  <% end %>
24
23
  <% unless options.skip_active_record -%>
24
+
25
25
  # puts "\n== Copying sample files =="
26
26
  # unless File.exist?('config/database.yml')
27
27
  # cp 'config/database.yml.sample', 'config/database.yml'
@@ -17,6 +17,7 @@ chdir APP_ROOT do
17
17
  system! 'gem install bundler --conservative'
18
18
  system('bundle check') || system!('bundle install')
19
19
  <% unless options.skip_active_record -%>
20
+
20
21
  puts "\n== Updating database =="
21
22
  system! 'bin/rails db:migrate'
22
23
  <% end -%>
@@ -34,6 +34,10 @@ module <%= app_const_base %>
34
34
  # Middleware like session, flash, cookies can be added back manually.
35
35
  # Skip views, helpers and assets when generating a new resource.
36
36
  config.api_only = true
37
+ <%- elsif !depends_on_system_test? -%>
38
+
39
+ # Don't generate system test files.
40
+ config.generators.system_tests = nil
37
41
  <%- end -%>
38
42
  end
39
43
  end
@@ -5,6 +5,9 @@
5
5
  # Once upgraded flip defaults one by one to migrate to the new default.
6
6
  #
7
7
  # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
+
9
+ # Make `form_with` generate non-remote forms.
10
+ Rails.application.config.action_view.form_with_generates_remote_forms = false
8
11
  <%- unless options[:skip_sprockets] -%>
9
12
 
10
13
  # Unknown asset fallback will return the path passed in when the given
@@ -12,8 +12,8 @@
12
12
 
13
13
  # Shared secrets are available across all environments.
14
14
 
15
- shared:
16
- api_key: 123
15
+ # shared:
16
+ # api_key: a1B2c3D4e5F6
17
17
 
18
18
  # Environmental secrets are only available for that specific environment.
19
19
 
@@ -4,7 +4,7 @@
4
4
  <title>The page you were looking for doesn't exist (404)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/404.html -->
59
59
  <div class="dialog">
60
60
  <div>
@@ -4,7 +4,7 @@
4
4
  <title>The change you wanted was rejected (422)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/422.html -->
59
59
  <div class="dialog">
60
60
  <div>
@@ -4,7 +4,7 @@
4
4
  <title>We're sorry, but something went wrong (500)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/500.html -->
59
59
  <div class="dialog">
60
60
  <div>
data/lib/rails/paths.rb CHANGED
@@ -205,7 +205,14 @@ module Rails
205
205
 
206
206
  # Returns all expanded paths but only if they exist in the filesystem.
207
207
  def existent
208
- expanded.select { |f| File.exist?(f) }
208
+ expanded.select do |f|
209
+ does_exist = File.exist?(f)
210
+
211
+ if !does_exist && File.symlink?(f)
212
+ raise "File #{f.inspect} is a symlink that does not point to a valid file"
213
+ end
214
+ does_exist
215
+ end
209
216
  end
210
217
 
211
218
  def existent_directories
data/lib/rails/secrets.rb CHANGED
@@ -14,12 +14,10 @@ module Rails
14
14
  end
15
15
 
16
16
  @cipher = "aes-128-gcm"
17
- @read_encrypted_secrets = false
18
17
  @root = File # Wonky, but ensures `join` uses the current directory.
19
18
 
20
19
  class << self
21
- attr_writer :root
22
- attr_accessor :read_encrypted_secrets
20
+ attr_writer :root
23
21
 
24
22
  def parse(paths, env:)
25
23
  paths.each_with_object(Hash.new) do |path, all_secrets|
@@ -88,11 +86,7 @@ module Rails
88
86
 
89
87
  def preprocess(path)
90
88
  if path.end_with?(".enc")
91
- if @read_encrypted_secrets
92
- decrypt(IO.binread(path))
93
- else
94
- ""
95
- end
89
+ decrypt(IO.binread(path))
96
90
  else
97
91
  IO.read(path)
98
92
  end
@@ -63,7 +63,7 @@ namespace :app do
63
63
 
64
64
  # desc "Adds new executables to the application bin/ directory"
65
65
  task :bin do
66
- RailsUpdate.invoke_from_app_generator :create_bin_files
66
+ RailsUpdate.invoke_from_app_generator :update_bin_files
67
67
  end
68
68
 
69
69
  task :upgrade_guide_info do
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: 5.1.0.rc1
4
+ version: 5.1.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-20 00:00:00.000000000 Z
11
+ date: 2017-04-21 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: 5.1.0.rc1
19
+ version: 5.1.0.rc2
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: 5.1.0.rc1
26
+ version: 5.1.0.rc2
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: 5.1.0.rc1
33
+ version: 5.1.0.rc2
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: 5.1.0.rc1
40
+ version: 5.1.0.rc2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 5.1.0.rc1
95
+ version: 5.1.0.rc2
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 5.1.0.rc1
102
+ version: 5.1.0.rc2
103
103
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
104
104
  email: david@loudthinking.com
105
105
  executables: