railties 5.0.0.beta1.1 → 5.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -6
  3. data/MIT-LICENSE +2 -2
  4. data/RDOC_MAIN.rdoc +1 -1
  5. data/lib/rails/application/default_middleware_stack.rb +1 -1
  6. data/lib/rails/application/finisher.rb +1 -1
  7. data/lib/rails/code_statistics.rb +1 -1
  8. data/lib/rails/commands/runner.rb +7 -1
  9. data/lib/rails/commands/server.rb +7 -3
  10. data/lib/rails/engine/commands.rb +3 -32
  11. data/lib/rails/engine/commands_tasks.rb +116 -0
  12. data/lib/rails/gem_version.rb +1 -1
  13. data/lib/rails/generators/actions.rb +2 -2
  14. data/lib/rails/generators/actions/create_migration.rb +1 -1
  15. data/lib/rails/generators/app_base.rb +22 -1
  16. data/lib/rails/generators/generated_attribute.rb +3 -2
  17. data/lib/rails/generators/named_base.rb +4 -0
  18. data/lib/rails/generators/rails/app/app_generator.rb +18 -2
  19. data/lib/rails/generators/rails/app/templates/Gemfile +0 -3
  20. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee +1 -1
  21. data/lib/rails/generators/rails/app/templates/app/channels/application_cable/channel.rb +1 -1
  22. data/lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb +1 -1
  23. data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -3
  24. data/lib/rails/generators/rails/app/templates/config/cable.yml +10 -0
  25. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +1 -1
  26. data/lib/rails/generators/rails/app/templates/config/initializers/active_record_belongs_to_required_by_default.rb +3 -2
  27. data/lib/rails/generators/rails/app/templates/config/initializers/callback_terminator.rb +3 -2
  28. data/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb +2 -1
  29. data/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb +4 -0
  30. data/lib/rails/generators/rails/app/templates/config/puma.rb +44 -0
  31. data/lib/rails/generators/rails/app/templates/config/secrets.yml +1 -1
  32. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +1 -1
  33. data/lib/rails/generators/rails/model/USAGE +4 -4
  34. data/lib/rails/generators/rails/plugin/plugin_generator.rb +7 -1
  35. data/lib/rails/generators/rails/plugin/templates/README.md +26 -1
  36. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +7 -0
  37. data/lib/rails/generators/rails/plugin/templates/app/models/{application_record.rb.tt → %namespaced_name%/application_record.rb.tt} +0 -0
  38. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb +1 -1
  39. data/lib/rails/generators/rails/scaffold/USAGE +1 -1
  40. data/lib/rails/generators/test_unit/controller/templates/functional_test.rb +1 -1
  41. data/lib/rails/generators/test_unit/model/templates/fixtures.yml +2 -2
  42. data/lib/rails/rack/logger.rb +0 -6
  43. data/lib/rails/tasks/engine.rake +2 -2
  44. data/lib/rails/tasks/log.rake +19 -6
  45. data/lib/rails/tasks/routes.rake +30 -2
  46. data/lib/rails/templates/rails/welcome/index.html.erb +61 -265
  47. data/lib/rails/test_unit/line_filtering.rb +70 -0
  48. data/lib/rails/test_unit/minitest_plugin.rb +12 -9
  49. data/lib/rails/test_unit/railtie.rb +6 -0
  50. data/lib/rails/test_unit/reporter.rb +37 -1
  51. data/lib/rails/test_unit/test_requirer.rb +1 -1
  52. data/lib/rails/test_unit/testing.rake +6 -1
  53. metadata +17 -13
  54. data/lib/rails/generators/rails/app/templates/config/redis/cable.yml +0 -9
  55. data/lib/rails/generators/rails/plugin/templates/app/mailers/.empty_directory +0 -0
  56. data/lib/rails/generators/rails/plugin/templates/app/models/.empty_directory +0 -0
@@ -1,3 +1,5 @@
1
+ require 'rails/test_unit/line_filtering'
2
+
1
3
  if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
2
4
  ENV['RAILS_ENV'] ||= 'test'
3
5
  end
@@ -11,6 +13,10 @@ module Rails
11
13
  c.integration_tool :test_unit
12
14
  end
13
15
 
16
+ initializer "test_unit.line_filtering" do
17
+ ActiveSupport::TestCase.extend Rails::LineFiltering
18
+ end
19
+
14
20
  rake_tasks do
15
21
  load "rails/test_unit/testing.rake"
16
22
  end
@@ -9,10 +9,16 @@ module Rails
9
9
  def record(result)
10
10
  super
11
11
 
12
+ if options[:verbose]
13
+ io.puts color_output(format_line(result), by: result)
14
+ else
15
+ io.print color_output(result.result_code, by: result)
16
+ end
17
+
12
18
  if output_inline? && result.failure && (!result.skipped? || options[:verbose])
13
19
  io.puts
14
20
  io.puts
15
- io.puts result.failures.map(&:message)
21
+ io.puts format_failures(result).map { |line| color_output(line, by: result) }
16
22
  io.puts
17
23
  io.puts format_rerun_snippet(result)
18
24
  io.puts
@@ -56,6 +62,16 @@ module Rails
56
62
  options[:fail_fast]
57
63
  end
58
64
 
65
+ def format_line(result)
66
+ "%s#%s = %.2f s = %s" % [result.class, result.name, result.time, result.result_code]
67
+ end
68
+
69
+ def format_failures(result)
70
+ result.failures.map do |failure|
71
+ "#{failure.result_label}:\n#{result.class}##{result.name}:\n#{failure.message}\n"
72
+ end
73
+ end
74
+
59
75
  def format_rerun_snippet(result)
60
76
  # Try to extract path to assertion from backtrace.
61
77
  if result.location =~ /\[(.*)\]\z/
@@ -70,5 +86,25 @@ module Rails
70
86
  def app_root
71
87
  @app_root ||= defined?(ENGINE_ROOT) ? ENGINE_ROOT : Rails.root
72
88
  end
89
+
90
+ def colored_output?
91
+ options[:color] && io.respond_to?(:tty?) && io.tty?
92
+ end
93
+
94
+ codes = { red: 31, green: 32, yellow: 33 }
95
+ COLOR_BY_RESULT_CODE = {
96
+ "." => codes[:green],
97
+ "E" => codes[:red],
98
+ "F" => codes[:red],
99
+ "S" => codes[:yellow]
100
+ }
101
+
102
+ def color_output(string, by:)
103
+ if colored_output?
104
+ "\e[#{COLOR_BY_RESULT_CODE[by.result_code]}m#{string}\e[0m"
105
+ else
106
+ string
107
+ end
108
+ end
73
109
  end
74
110
  end
@@ -15,7 +15,7 @@ module Rails
15
15
  private
16
16
  def expand_patterns(patterns)
17
17
  patterns.map do |arg|
18
- arg = arg.gsub(/:(\d+)?$/, '')
18
+ arg = arg.gsub(/(:\d+)+?$/, '')
19
19
  if Dir.exist?(arg)
20
20
  "#{arg}/**/*_test.rb"
21
21
  else
@@ -7,7 +7,12 @@ task default: :test
7
7
  desc "Runs all tests in test folder"
8
8
  task :test do
9
9
  $: << "test"
10
- Minitest.rake_run(["test"])
10
+ pattern = if ENV.key?('TEST')
11
+ ENV['TEST']
12
+ else
13
+ "test"
14
+ end
15
+ Minitest.rake_run([pattern])
11
16
  end
12
17
 
13
18
  namespace :test 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.0.0.beta1.1
4
+ version: 5.0.0.beta2
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-01-25 00:00:00.000000000 Z
11
+ date: 2016-02-01 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.0.beta1.1
19
+ version: 5.0.0.beta2
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.0.beta1.1
26
+ version: 5.0.0.beta2
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.0.beta1.1
33
+ version: 5.0.0.beta2
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.0.beta1.1
40
+ version: 5.0.0.beta2
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.0.beta1.1
95
+ version: 5.0.0.beta2
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.0.beta1.1
102
+ version: 5.0.0.beta2
103
103
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
104
104
  email: david@loudthinking.com
105
105
  executables:
@@ -147,6 +147,7 @@ files:
147
147
  - lib/rails/console/helpers.rb
148
148
  - lib/rails/engine.rb
149
149
  - lib/rails/engine/commands.rb
150
+ - lib/rails/engine/commands_tasks.rb
150
151
  - lib/rails/engine/configuration.rb
151
152
  - lib/rails/engine/railties.rb
152
153
  - lib/rails/gem_version.rb
@@ -204,6 +205,7 @@ files:
204
205
  - lib/rails/generators/rails/app/templates/config.ru.tt
205
206
  - lib/rails/generators/rails/app/templates/config/application.rb
206
207
  - lib/rails/generators/rails/app/templates/config/boot.rb
208
+ - lib/rails/generators/rails/app/templates/config/cable.yml
207
209
  - lib/rails/generators/rails/app/templates/config/databases/frontbase.yml
208
210
  - lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml
209
211
  - lib/rails/generators/rails/app/templates/config/databases/jdbc.yml
@@ -229,11 +231,12 @@ files:
229
231
  - lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb
230
232
  - lib/rails/generators/rails/app/templates/config/initializers/inflections.rb
231
233
  - lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb
234
+ - lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb
232
235
  - lib/rails/generators/rails/app/templates/config/initializers/request_forgery_protection.rb
233
236
  - lib/rails/generators/rails/app/templates/config/initializers/session_store.rb.tt
234
237
  - lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
235
238
  - lib/rails/generators/rails/app/templates/config/locales/en.yml
236
- - lib/rails/generators/rails/app/templates/config/redis/cable.yml
239
+ - lib/rails/generators/rails/app/templates/config/puma.rb
237
240
  - lib/rails/generators/rails/app/templates/config/routes.rb
238
241
  - lib/rails/generators/rails/app/templates/config/secrets.yml
239
242
  - lib/rails/generators/rails/app/templates/db/seeds.rb.tt
@@ -275,9 +278,8 @@ files:
275
278
  - lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt
276
279
  - lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt
277
280
  - lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt
278
- - lib/rails/generators/rails/plugin/templates/app/mailers/.empty_directory
279
- - lib/rails/generators/rails/plugin/templates/app/models/.empty_directory
280
- - lib/rails/generators/rails/plugin/templates/app/models/application_record.rb.tt
281
+ - lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt
282
+ - lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt
281
283
  - lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt
282
284
  - lib/rails/generators/rails/plugin/templates/bin/rails.tt
283
285
  - lib/rails/generators/rails/plugin/templates/bin/test.tt
@@ -370,6 +372,7 @@ files:
370
372
  - lib/rails/templates/rails/mailers/mailer.html.erb
371
373
  - lib/rails/templates/rails/welcome/index.html.erb
372
374
  - lib/rails/test_help.rb
375
+ - lib/rails/test_unit/line_filtering.rb
373
376
  - lib/rails/test_unit/minitest_plugin.rb
374
377
  - lib/rails/test_unit/railtie.rb
375
378
  - lib/rails/test_unit/reporter.rb
@@ -399,8 +402,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
402
  version: 1.3.1
400
403
  requirements: []
401
404
  rubyforge_project:
402
- rubygems_version: 2.5.1
405
+ rubygems_version: 2.5.2
403
406
  signing_key:
404
407
  specification_version: 4
405
408
  summary: Tools for creating, working with, and running Rails applications.
406
409
  test_files: []
410
+ has_rdoc:
@@ -1,9 +0,0 @@
1
- # Action Cable uses Redis to administer connections, channels, and sending/receiving messages over the WebSocket.
2
- production:
3
- url: redis://localhost:6379/1
4
-
5
- development:
6
- url: redis://localhost:6379/2
7
-
8
- test:
9
- url: redis://localhost:6379/3