railties 5.2.0 → 5.2.1.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of railties might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25be2ea21e6618d4a5c4925a8e2bc17a1085268558eddf1fbac80bfe19c08b08
4
- data.tar.gz: 1ff96ab5e5d5822bbbc11b87e3acd71ae326fc18e24c1f8173c9393cd61a8746
3
+ metadata.gz: 04d31289b952be4bd2fb7323ac8a5a8813f306d8da419aaa6c30f1b4bbf6d606
4
+ data.tar.gz: 6b7a85a109d6b54489071f4d261b3b18275d2e73745049a73feeee8e6fc5f1b6
5
5
  SHA512:
6
- metadata.gz: 1585f8b3b3ea57f8350b894e6129b09bdfc518c4bbce249ca048fa832585334d4238e654bec9c6eecb4c3c6f9459299e70f2ea0a07704d8118e2c508eac9176c
7
- data.tar.gz: 73b84a73871f51ae45113565928eec4321119c0aa8260498cee99c534d35325c94197033d5a8f0451fdd859e4a2c43f8a20119e72b2586ddb56b465da0516380
6
+ metadata.gz: 90047f139eec1e596e77cf5a49bb75ccd5c7236da789a8985afdcf20a05c463ce36e8a3d41818e93c232ec479f99b7c7afb41ef36e63c4c86a52646adb56f8ea
7
+ data.tar.gz: d92f188c9c84d35e99e7a2922b2b71ecec4a7ecbf750c1c17319ef7fc09ea6a44ffbd48f4c2506d5f9fdeecd61be1c67462e321f587054b2c4b820ecc0901cf6
@@ -1,3 +1,53 @@
1
+ ## Rails 5.2.1.rc1 (July 30, 2018) ##
2
+
3
+ * Respect `NODE_ENV` when running `rails yarn:install`.
4
+
5
+ *Max Melentiev*
6
+
7
+ * Don't generate unused files in `app:update` task
8
+
9
+ Skip the assets' initializer when sprockets isn't loaded.
10
+
11
+ Skip `config/spring.rb` when spring isn't loaded.
12
+
13
+ *Tsukuru Tanimichi*
14
+
15
+ * Don't include `bootsnap` by default in apps generated under JRuby.
16
+
17
+ Fixes #32641.
18
+
19
+ *Guillermo Iguaran*
20
+
21
+ * Create the `.ruby-version` file compatible with MRI/JRuby by default.
22
+
23
+ Fixes #32639.
24
+
25
+ *Guillermo Iguaran*
26
+
27
+ * Make the master.key file read-only for the owner upon generation on
28
+ POSIX-compliant systems.
29
+
30
+ Previously:
31
+
32
+ $ ls -l config/master.key
33
+ -rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
34
+
35
+ Now:
36
+
37
+ $ ls -l config/master.key
38
+ -rw------- 1 owner group 32 Jan 1 00:00 master.key
39
+
40
+ Fixes #32604.
41
+
42
+ *Jose Luis Duran*
43
+
44
+ * Allow use of `minitest-rails` gem with Rails test runner.
45
+
46
+ Fixes #31324.
47
+
48
+ *Yuji Yaginuma*
49
+
50
+
1
51
  ## Rails 5.2.0 (April 09, 2018) ##
2
52
 
3
53
  * Fix minitest rails plugin.
@@ -13,7 +13,7 @@ module Minitest
13
13
  end
14
14
 
15
15
  def self.plugin_rails_options(opts, options)
16
- Rails::TestUnit::Runner.attach_before_load_options(opts)
16
+ ::Rails::TestUnit::Runner.attach_before_load_options(opts)
17
17
 
18
18
  opts.on("-b", "--backtrace", "Show the complete backtrace") do
19
19
  options[:full_backtrace] = true
@@ -27,6 +27,7 @@ module Rails
27
27
  options[:skip_action_cable] = !defined?(ActionCable::Engine)
28
28
  options[:skip_sprockets] = !defined?(Sprockets::Railtie)
29
29
  options[:skip_puma] = !defined?(Puma)
30
+ options[:skip_spring] = !defined?(Spring)
30
31
  options
31
32
  end
32
33
  end
@@ -427,7 +427,7 @@ module Rails
427
427
  # the correct place to store it is in the encrypted credentials file.
428
428
  def secret_key_base
429
429
  if Rails.env.test? || Rails.env.development?
430
- Digest::MD5.hexdigest self.class.name
430
+ secrets.secret_key_base || Digest::MD5.hexdigest(self.class.name)
431
431
  else
432
432
  validate_secret_key_base(
433
433
  ENV["SECRET_KEY_BASE"] || credentials.secret_key_base || secrets.secret_key_base
@@ -127,7 +127,7 @@ module Rails
127
127
  initializer :set_routes_reloader_hook do |app|
128
128
  reloader = routes_reloader
129
129
  reloader.eager_load = app.config.eager_load
130
- reloader.execute_if_updated
130
+ reloader.execute
131
131
  reloaders << reloader
132
132
  app.reloader.to_run do
133
133
  # We configure #execute rather than #execute_if_updated because if
@@ -7,7 +7,7 @@ module Rails
7
7
  class RoutesReloader
8
8
  attr_reader :route_sets, :paths
9
9
  attr_accessor :eager_load
10
- delegate :updated?, to: :updater
10
+ delegate :execute_if_updated, :execute, :updated?, to: :updater
11
11
 
12
12
  def initialize
13
13
  @paths = []
@@ -19,31 +19,15 @@ module Rails
19
19
  clear!
20
20
  load_paths
21
21
  finalize!
22
+ route_sets.each(&:eager_load!) if eager_load
22
23
  ensure
23
24
  revert
24
25
  end
25
26
 
26
- def execute
27
- ret = updater.execute
28
- route_sets.each(&:eager_load!) if eager_load
29
- ret
30
- end
31
-
32
- def execute_if_updated
33
- if updated = updater.execute_if_updated
34
- route_sets.each(&:eager_load!) if eager_load
35
- end
36
- updated
37
- end
38
-
39
27
  private
40
28
 
41
29
  def updater
42
- @updater ||= begin
43
- updater = ActiveSupport::FileUpdateChecker.new(paths) { reload! }
44
- updater.execute
45
- updater
46
- end
30
+ @updater ||= ActiveSupport::FileUpdateChecker.new(paths) { reload! }
47
31
  end
48
32
 
49
33
  def clear!
@@ -9,8 +9,8 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 5
11
11
  MINOR = 2
12
- TINY = 0
13
- PRE = nil
12
+ TINY = 1
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -441,7 +441,7 @@ module Rails
441
441
  end
442
442
 
443
443
  def depend_on_bootsnap?
444
- !options[:skip_bootsnap] && !options[:dev]
444
+ !options[:skip_bootsnap] && !options[:dev] && !defined?(JRUBY_VERSION)
445
445
  end
446
446
 
447
447
  def os_supports_listen_out_of_the_box?
@@ -146,6 +146,10 @@ module Rails
146
146
  template "config/storage.yml"
147
147
  end
148
148
 
149
+ if options[:skip_sprockets] && !assets_config_exist
150
+ remove_file "config/initializers/assets.rb"
151
+ end
152
+
149
153
  unless rack_cors_config_exist
150
154
  remove_file "config/initializers/cors.rb"
151
155
  end
@@ -69,7 +69,7 @@ end
69
69
  <%- if depends_on_system_test? -%>
70
70
  group :test do
71
71
  # Adds support for Capybara system testing and selenium driver
72
- gem 'capybara', '>= 2.15', '< 4.0'
72
+ gem 'capybara', '>= 2.15'
73
73
  gem 'selenium-webdriver'
74
74
  # Easy installation and use of chromedriver to run system tests with Chrome
75
75
  gem 'chromedriver-helper'
@@ -33,3 +33,6 @@
33
33
 
34
34
  # Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
35
35
  # Rails.application.config.active_support.use_sha1_digests = true
36
+
37
+ # Make `form_with` generate id attributes for any generated HTML tags.
38
+ # Rails.application.config.action_view.form_with_generates_ids = true
@@ -24,8 +24,11 @@
24
24
  <% unless skip_active_storage? -%>
25
25
  # Ignore uploaded files in development
26
26
  /storage/*
27
-
27
+ <% if keeps? -%>
28
+ !/storage/.keep
28
29
  <% end -%>
30
+ <% end -%>
31
+
29
32
  <% unless options.skip_yarn? -%>
30
33
  /node_modules
31
34
  /yarn-error.log
@@ -1 +1 @@
1
- <%= RUBY_VERSION -%>
1
+ <%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{defined?(JRUBY_VERSION) ? JRUBY_VERSION : RUBY_VERSION}" -%>
@@ -27,6 +27,7 @@ module Rails
27
27
 
28
28
  def add_key_file_silently(key_path, key = nil)
29
29
  create_file key_path, key || ActiveSupport::EncryptedFile.generate_key
30
+ key_path.chmod 0600
30
31
  end
31
32
 
32
33
  def ignore_key_file(key_path, ignore: key_ignore(key_path))
@@ -35,9 +35,9 @@ module Rails
35
35
  instrumenter = ActiveSupport::Notifications.instrumenter
36
36
  instrumenter.start "request.action_dispatch", request: request
37
37
  logger.info { started_request_message(request) }
38
- resp = @app.call(env)
39
- resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) }
40
- resp
38
+ status, headers, body = @app.call(env)
39
+ body = ::Rack::BodyProxy.new(body) { finish(request) }
40
+ [status, headers, body]
41
41
  rescue Exception
42
42
  finish(request)
43
43
  raise
@@ -40,7 +40,7 @@ namespace :app do
40
40
  namespace :update do
41
41
  require "rails/app_updater"
42
42
 
43
- # desc "Update config/boot.rb from your current rails install"
43
+ # desc "Update config files from your current rails install"
44
44
  task :configs do
45
45
  Rails::AppUpdater.invoke_from_app_generator :create_boot_file
46
46
  Rails::AppUpdater.invoke_from_app_generator :update_config_files
@@ -3,7 +3,13 @@
3
3
  namespace :yarn do
4
4
  desc "Install all JavaScript dependencies as specified via Yarn"
5
5
  task :install do
6
- system("./bin/yarn install --no-progress --production")
6
+ # Install only production deps when for not usual envs.
7
+ valid_node_envs = %w[test development production]
8
+ node_env = ENV.fetch("NODE_ENV") do
9
+ rails_env = ENV["RAILS_ENV"]
10
+ valid_node_envs.include?(rails_env) ? rails_env : "production"
11
+ end
12
+ system({ "NODE_ENV" => node_env }, "./bin/yarn install --no-progress")
7
13
  end
8
14
  end
9
15
 
@@ -98,7 +98,7 @@
98
98
  <dt>Format:</dt>
99
99
  <% if @email.multipart? %>
100
100
  <dd>
101
- <select id="part" onchange="refreshBody();">
101
+ <select id="part" onchange="refreshBody(false);">
102
102
  <option <%= request.format == Mime[:html] ? 'selected' : '' %> value="<%= part_query('text/html') %>">View as HTML email</option>
103
103
  <option <%= request.format == Mime[:text] ? 'selected' : '' %> value="<%= part_query('text/plain') %>">View as plain-text email</option>
104
104
  </select>
@@ -110,7 +110,7 @@
110
110
  <% if I18n.available_locales.count > 1 %>
111
111
  <dt>Locale:</dt>
112
112
  <dd>
113
- <select id="locale" onchange="refreshBody();">
113
+ <select id="locale" onchange="refreshBody(true);">
114
114
  <% I18n.available_locales.each do |locale| %>
115
115
  <option <%= I18n.locale == locale ? 'selected' : '' %> value="<%= locale_query(locale) %>"><%= locale %></option>
116
116
  <% end %>
@@ -130,7 +130,7 @@
130
130
  <% end %>
131
131
 
132
132
  <script>
133
- function refreshBody() {
133
+ function refreshBody(reload) {
134
134
  var part_select = document.querySelector('select#part');
135
135
  var locale_select = document.querySelector('select#locale');
136
136
  var iframe = document.getElementsByName('messageBody')[0];
@@ -146,10 +146,13 @@
146
146
  }
147
147
  iframe.contentWindow.location = fresh_location;
148
148
 
149
- if (history.replaceState) {
150
- var url = location.pathname.replace(/\.(txt|html)$/, '');
151
- var format = /html/.test(part_param) ? '.html' : '.txt';
152
- var state_to_replace = locale_param ? (url + format + '?' + locale_param) : (url + format);
149
+ var url = location.pathname.replace(/\.(txt|html)$/, '');
150
+ var format = /html/.test(part_param) ? '.html' : '.txt';
151
+ var state_to_replace = locale_param ? (url + format + '?' + locale_param) : (url + format);
152
+
153
+ if (reload) {
154
+ location.href = state_to_replace;
155
+ } else if (history.replaceState) {
153
156
  window.history.replaceState({}, '', state_to_replace);
154
157
  }
155
158
  }
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.2.0
4
+ version: 5.2.1.rc1
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: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-07-30 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.2.0
19
+ version: 5.2.1.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: 5.2.0
26
+ version: 5.2.1.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: 5.2.0
33
+ version: 5.2.1.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: 5.2.0
40
+ version: 5.2.1.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.18.1
61
+ version: 0.19.0
62
62
  - - "<"
63
63
  - !ruby/object:Gem::Version
64
64
  version: '2.0'
@@ -68,7 +68,7 @@ dependencies:
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
- version: 0.18.1
71
+ version: 0.19.0
72
72
  - - "<"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '2.0'
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 5.2.0
95
+ version: 5.2.1.rc1
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.2.0
102
+ version: 5.2.1.rc1
103
103
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
104
104
  email: david@loudthinking.com
105
105
  executables:
@@ -421,8 +421,8 @@ homepage: http://rubyonrails.org
421
421
  licenses:
422
422
  - MIT
423
423
  metadata:
424
- source_code_uri: https://github.com/rails/rails/tree/v5.2.0/railties
425
- changelog_uri: https://github.com/rails/rails/blob/v5.2.0/railties/CHANGELOG.md
424
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.1.rc1/railties
425
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.1.rc1/railties/CHANGELOG.md
426
426
  post_install_message:
427
427
  rdoc_options:
428
428
  - "--exclude"
@@ -436,12 +436,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
436
436
  version: 2.2.2
437
437
  required_rubygems_version: !ruby/object:Gem::Requirement
438
438
  requirements:
439
- - - ">="
439
+ - - ">"
440
440
  - !ruby/object:Gem::Version
441
- version: '0'
441
+ version: 1.3.1
442
442
  requirements: []
443
443
  rubyforge_project:
444
- rubygems_version: 2.7.6
444
+ rubygems_version: 2.7.3
445
445
  signing_key:
446
446
  specification_version: 4
447
447
  summary: Tools for creating, working with, and running Rails applications.