railties 5.0.1 → 5.0.2.rc1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2d7a4c18e24342d824a551fd8029c9adf817608
4
- data.tar.gz: 166c7a90d852bfa1e38bbda766cbb486b1410a0f
3
+ metadata.gz: a62a5797f3d9d5c6a2152ebcec3c66845eff8059
4
+ data.tar.gz: 79b8be66916fbd1293b029d9e48eeae591068eec
5
5
  SHA512:
6
- metadata.gz: b2a91f269c9e33fe5fb40ca05f3817fac0aae0d724c4dbe030e01162114f49f14e3932bfaa017f7ffcafa10c3dd8dfdfdc1bd670377a6a3b72b8e09f4e5c1945
7
- data.tar.gz: 7065ea82a79dba7659ad1d7e1c10166362ce1bd57bd2f069141b7a05cae0b52364a6b18f062f8857bae52e9cabedd7c6f786555ced8737662a83a581ccaaaeca
6
+ metadata.gz: b38d3f134f20246d559987770e65f7d045737378a55f31457829dc814ab9cdfe43da32907c50ebf2479db7dbbdb8289f6d701000b13e6d374bd6e028d64012b1
7
+ data.tar.gz: 837a247f17fc3ca04dfdc90fb4b6f584d81e152fc13bd2367e9ab49a19ba9a035d011b5b90435e81bd7044fea6e033d1db895ea53fbeaf16104496e0e137dbdf
@@ -1,3 +1,28 @@
1
+ ## Rails 5.0.2.rc1 (February 24, 2017) ##
2
+
3
+ * Fix running multiple tests in one `rake` command
4
+
5
+ e.g. `bin/rake test:models test:controllers`
6
+
7
+ *Dominic Cleal*
8
+
9
+ * Don't generate HTML/ERB templates for scaffold controller with `--api` flag.
10
+
11
+ Fixes #27591.
12
+
13
+ *Prathamesh Sonpatki*
14
+
15
+ * Make `Rails.env` fall back to `development` when `RAILS_ENV` and `RACK_ENV` is an empty string.
16
+
17
+ *Daniel Deng*
18
+
19
+ * Reset a new session directly after its creation in ActionDispatch::IntegrationTest#open_session
20
+
21
+ Fixes Issue #22742
22
+
23
+ *Tawan Sierek*
24
+
25
+
1
26
  ## Rails 5.0.1 (December 21, 2016) ##
2
27
 
3
28
  * No changes.
@@ -7,6 +7,7 @@ require 'active_support/dependencies/autoload'
7
7
  require 'active_support/core_ext/kernel/reporting'
8
8
  require 'active_support/core_ext/module/delegation'
9
9
  require 'active_support/core_ext/array/extract_options'
10
+ require 'active_support/core_ext/object/blank'
10
11
 
11
12
  require 'rails/application'
12
13
  require 'rails/version'
@@ -67,7 +68,7 @@ module Rails
67
68
  # Rails.env.development? # => true
68
69
  # Rails.env.production? # => false
69
70
  def env
70
- @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development")
71
+ @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development")
71
72
  end
72
73
 
73
74
  # Sets the Rails environment.
@@ -6,6 +6,6 @@ else
6
6
  $LOAD_PATH << File.expand_path("../../test", APP_PATH)
7
7
  end
8
8
 
9
- Minitest.run_via[:rails] = true
9
+ Minitest.run_via = :rails
10
10
 
11
11
  require "active_support/testing/autorun"
@@ -7,8 +7,8 @@ module Rails
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
- TINY = 1
11
- PRE = nil
10
+ TINY = 2
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -78,6 +78,10 @@ module Rails
78
78
  !options[:skip_namespace] && namespace
79
79
  end
80
80
 
81
+ def namespace_dirs
82
+ @namespace_dirs ||= namespace.name.split("::").map(&:underscore)
83
+ end
84
+
81
85
  def file_path
82
86
  @file_path ||= (class_path + [file_name]).join('/')
83
87
  end
@@ -95,11 +99,11 @@ module Rails
95
99
  end
96
100
 
97
101
  def namespaced_class_path
98
- @namespaced_class_path ||= [namespaced_path] + @class_path
102
+ @namespaced_class_path ||= namespace_dirs + @class_path
99
103
  end
100
104
 
101
105
  def namespaced_path
102
- @namespaced_path ||= namespace.name.split("::").first.underscore
106
+ @namespaced_path ||= namespace_dirs.join("/")
103
107
  end
104
108
 
105
109
  def class_name
@@ -1,4 +1,4 @@
1
- # SQL Server (2005 or higher recommended)
1
+ # SQL Server (2012 or higher recommended)
2
2
  #
3
3
  # Install the adapters and driver
4
4
  # gem install tiny_tds
@@ -8,28 +8,12 @@
8
8
  # gem 'tiny_tds'
9
9
  # gem 'activerecord-sqlserver-adapter'
10
10
  #
11
- # You should make sure freetds is configured correctly first.
12
- # freetds.conf contains host/port/protocol_versions settings.
13
- # http://freetds.schemamania.org/userguide/freetdsconf.htm
14
- #
15
- # A typical Microsoft server
16
- # [mssql]
17
- # host = mssqlserver.yourdomain.com
18
- # port = 1433
19
- # tds version = 7.1
20
-
21
- # If you can connect with "tsql -S servername", your basic FreeTDS installation is working.
22
- # 'man tsql' for more info
23
- # Set timeout to a larger number if valid queries against a live db fail
24
- #
25
11
  default: &default
26
12
  adapter: sqlserver
27
13
  encoding: utf8
28
- reconnect: false
29
- username: <%= app_name %>
30
- password:
31
- timeout: 25
32
- dataserver: from_freetds.conf
14
+ username: sa
15
+ password: <%= ENV['SA_PASSWORD'] %>
16
+ host: localhost
33
17
 
34
18
  development:
35
19
  <<: *default
@@ -5,6 +5,6 @@ require 'rails/test_unit/minitest_plugin'
5
5
 
6
6
  Rails::TestUnitReporter.executable = 'bin/test'
7
7
 
8
- Minitest.run_via[:rails] = true
8
+ Minitest.run_via = :rails
9
9
 
10
10
  require "active_support/testing/autorun"
@@ -20,7 +20,12 @@ module Rails
20
20
  template template_file, File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
21
21
  end
22
22
 
23
- hook_for :template_engine, :test_framework, as: :scaffold
23
+
24
+ hook_for :template_engine, as: :scaffold do |template_engine|
25
+ invoke template_engine unless options.api?
26
+ end
27
+
28
+ hook_for :test_framework, as: :scaffold
24
29
 
25
30
  # Invoke the helper using the controller name (pluralized)
26
31
  hook_for :helper, as: :scaffold do |invoked|
@@ -1,7 +1,9 @@
1
1
  require 'test_helper'
2
2
 
3
+ <% module_namespacing do -%>
3
4
  class <%= class_name %>Test < ActionDispatch::IntegrationTest
4
5
  # test "the truth" do
5
6
  # assert true
6
7
  # end
7
8
  end
9
+ <% end -%>
@@ -22,7 +22,7 @@ module TestUnit # :nodoc:
22
22
  def fixture_name
23
23
  @fixture_name ||=
24
24
  if mountable_engine?
25
- "%s_%s" % [namespaced_path, table_name]
25
+ (namespace_dirs + [table_name]).join("_")
26
26
  else
27
27
  table_name
28
28
  end
@@ -54,19 +54,18 @@ module Minitest
54
54
 
55
55
  options[:color] = true
56
56
  options[:output_inline] = true
57
- options[:patterns] = defined?(@rake_patterns) ? @rake_patterns : opts.order!
57
+ options[:patterns] = opts.order! unless run_via.rake?
58
58
  end
59
59
 
60
- # Running several Rake tasks in a single command would trip up the runner,
61
- # as the patterns would also contain the other Rake tasks.
62
60
  def self.rake_run(patterns) # :nodoc:
63
- @rake_patterns = patterns
61
+ self.run_via = :rake unless run_via.set?
62
+ ::Rails::TestRequirer.require_files(patterns)
64
63
  autorun
65
64
  end
66
65
 
67
66
  module RunRespectingRakeTestopts
68
67
  def run(args = [])
69
- if defined?(@rake_patterns)
68
+ if run_via.rake?
70
69
  args = Shellwords.split(ENV["TESTOPTS"] || "")
71
70
  end
72
71
 
@@ -81,8 +80,9 @@ module Minitest
81
80
  def self.plugin_rails_init(options)
82
81
  ENV["RAILS_ENV"] = options[:environment] || "test"
83
82
 
84
- # If run via `ruby` we've been passed the files to run directly.
85
- unless run_via[:ruby]
83
+ # If run via `ruby` we've been passed the files to run directly, or if run
84
+ # via `rake` then they have already been eagerly required.
85
+ unless run_via.ruby? || run_via.rake?
86
86
  ::Rails::TestRequirer.require_files(options[:patterns])
87
87
  end
88
88
 
@@ -97,7 +97,33 @@ module Minitest
97
97
  reporter << ::Rails::TestUnitReporter.new(options[:io], options)
98
98
  end
99
99
 
100
- mattr_accessor(:run_via) { Hash.new }
100
+ def self.run_via=(runner)
101
+ if run_via.set?
102
+ raise ArgumentError, "run_via already assigned"
103
+ else
104
+ run_via.runner = runner
105
+ end
106
+ end
107
+
108
+ class RunVia
109
+ attr_accessor :runner
110
+ alias set? runner
111
+
112
+ # Backwardscompatibility with Rails 5.0 generated plugin test scripts.
113
+ def []=(runner, *)
114
+ @runner = runner
115
+ end
116
+
117
+ def ruby?
118
+ runner == :ruby
119
+ end
120
+
121
+ def rake?
122
+ runner == :rake
123
+ end
124
+ end
125
+
126
+ mattr_reader(:run_via) { RunVia.new }
101
127
  end
102
128
 
103
129
  # Put Rails as the first plugin minitest initializes so other plugins
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.0.1
4
+ version: 5.0.2.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: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2017-02-25 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.0.1
19
+ version: 5.0.2.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.0.1
26
+ version: 5.0.2.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.0.1
33
+ version: 5.0.2.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.0.1
40
+ version: 5.0.2.rc1
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.0.1
95
+ version: 5.0.2.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.0.1
102
+ version: 5.0.2.rc1
103
103
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
104
104
  email: david@loudthinking.com
105
105
  executables:
@@ -399,14 +399,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
399
399
  version: 2.2.2
400
400
  required_rubygems_version: !ruby/object:Gem::Requirement
401
401
  requirements:
402
- - - ">="
402
+ - - ">"
403
403
  - !ruby/object:Gem::Version
404
- version: '0'
404
+ version: 1.3.1
405
405
  requirements: []
406
406
  rubyforge_project:
407
- rubygems_version: 2.5.2
407
+ rubygems_version: 2.6.10
408
408
  signing_key:
409
409
  specification_version: 4
410
410
  summary: Tools for creating, working with, and running Rails applications.
411
411
  test_files: []
412
- has_rdoc: