railties 5.0.1 → 5.0.2.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/lib/rails.rb +2 -1
- data/lib/rails/commands/test.rb +1 -1
- data/lib/rails/gem_version.rb +2 -2
- data/lib/rails/generators/named_base.rb +6 -2
- data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml +4 -20
- data/lib/rails/generators/rails/plugin/templates/bin/test.tt +1 -1
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +6 -1
- data/lib/rails/generators/test_unit/integration/templates/integration_test.rb +2 -0
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +1 -1
- data/lib/rails/test_unit/minitest_plugin.rb +34 -8
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a62a5797f3d9d5c6a2152ebcec3c66845eff8059
|
4
|
+
data.tar.gz: 79b8be66916fbd1293b029d9e48eeae591068eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b38d3f134f20246d559987770e65f7d045737378a55f31457829dc814ab9cdfe43da32907c50ebf2479db7dbbdb8289f6d701000b13e6d374bd6e028d64012b1
|
7
|
+
data.tar.gz: 837a247f17fc3ca04dfdc90fb4b6f584d81e152fc13bd2367e9ab49a19ba9a035d011b5b90435e81bd7044fea6e033d1db895ea53fbeaf16104496e0e137dbdf
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
data/lib/rails.rb
CHANGED
@@ -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.
|
data/lib/rails/commands/test.rb
CHANGED
data/lib/rails/gem_version.rb
CHANGED
@@ -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 ||=
|
102
|
+
@namespaced_class_path ||= namespace_dirs + @class_path
|
99
103
|
end
|
100
104
|
|
101
105
|
def namespaced_path
|
102
|
-
@namespaced_path ||=
|
106
|
+
@namespaced_path ||= namespace_dirs.join("/")
|
103
107
|
end
|
104
108
|
|
105
109
|
def class_name
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SQL Server (
|
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
|
-
|
29
|
-
|
30
|
-
|
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
|
@@ -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
|
-
|
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|
|
@@ -54,19 +54,18 @@ module Minitest
|
|
54
54
|
|
55
55
|
options[:color] = true
|
56
56
|
options[:output_inline] = true
|
57
|
-
options[:patterns] =
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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:
|
404
|
+
version: 1.3.1
|
405
405
|
requirements: []
|
406
406
|
rubyforge_project:
|
407
|
-
rubygems_version: 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:
|