railties 5.0.0.beta3 → 5.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -19
  3. data/lib/rails/all.rb +2 -2
  4. data/lib/rails/app_loader.rb +1 -1
  5. data/lib/rails/application.rb +8 -6
  6. data/lib/rails/application/bootstrap.rb +4 -3
  7. data/lib/rails/application/configuration.rb +5 -5
  8. data/lib/rails/application/default_middleware_stack.rb +3 -19
  9. data/lib/rails/application/finisher.rb +73 -13
  10. data/lib/rails/code_statistics.rb +1 -0
  11. data/lib/rails/commands.rb +2 -2
  12. data/lib/rails/commands/runner.rb +4 -3
  13. data/lib/rails/commands/server.rb +10 -18
  14. data/lib/rails/console/app.rb +1 -2
  15. data/lib/rails/dev_caching.rb +43 -0
  16. data/lib/rails/gem_version.rb +1 -1
  17. data/lib/rails/generators/actions.rb +21 -8
  18. data/lib/rails/generators/actions/create_migration.rb +1 -0
  19. data/lib/rails/generators/app_base.rb +2 -1
  20. data/lib/rails/generators/erb/mailer/mailer_generator.rb +1 -1
  21. data/lib/rails/generators/rails/app/app_generator.rb +20 -2
  22. data/lib/rails/generators/rails/app/templates/Gemfile +3 -3
  23. data/lib/rails/generators/rails/app/templates/README.md +1 -1
  24. data/lib/rails/generators/rails/app/templates/Rakefile +1 -1
  25. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js +13 -0
  26. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +2 -5
  27. data/lib/rails/generators/rails/app/templates/bin/rails +1 -1
  28. data/lib/rails/generators/rails/app/templates/bin/setup +1 -1
  29. data/lib/rails/generators/rails/app/templates/bin/update +1 -1
  30. data/lib/rails/generators/rails/app/templates/config.ru +5 -0
  31. data/lib/rails/generators/rails/app/templates/config/application.rb +1 -1
  32. data/lib/rails/generators/rails/app/templates/config/boot.rb +1 -1
  33. data/lib/rails/generators/rails/app/templates/config/environment.rb +1 -1
  34. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +2 -17
  35. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +13 -12
  36. data/lib/rails/generators/rails/app/templates/config/initializers/ssl_options.rb +4 -0
  37. data/lib/rails/generators/rails/app/templates/config/initializers/to_time_preserves_timezone.rb +10 -0
  38. data/lib/rails/generators/rails/app/templates/config/routes.rb +0 -3
  39. data/lib/rails/generators/rails/app/templates/config/spring.rb +6 -0
  40. data/lib/rails/generators/rails/plugin/templates/Rakefile +1 -1
  41. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +2 -1
  42. data/lib/rails/generators/rails/plugin/templates/rails/application.rb +5 -3
  43. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb +2 -2
  44. data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +1 -1
  45. data/lib/rails/railtie.rb +37 -38
  46. data/lib/rails/tasks/dev.rake +3 -9
  47. data/lib/rails/tasks/framework.rake +20 -5
  48. data/lib/rails/tasks/misc.rake +23 -6
  49. data/lib/rails/tasks/restart.rake +6 -3
  50. data/lib/rails/tasks/routes.rake +3 -0
  51. data/lib/rails/tasks/statistics.rake +1 -0
  52. data/lib/rails/tasks/tmp.rake +4 -6
  53. data/lib/rails/test_unit/minitest_plugin.rb +10 -9
  54. metadata +16 -13
  55. data/lib/rails/command.rb +0 -70
  56. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee +0 -11
  57. data/lib/rails/generators/rails/app/templates/config.ru.tt +0 -10
@@ -5,9 +5,7 @@ namespace :tmp do
5
5
  tmp_dirs = [ 'tmp/cache',
6
6
  'tmp/sockets',
7
7
  'tmp/pids',
8
- 'tmp/cache/assets/development',
9
- 'tmp/cache/assets/test',
10
- 'tmp/cache/assets/production' ]
8
+ 'tmp/cache/assets' ]
11
9
 
12
10
  tmp_dirs.each { |d| directory d }
13
11
 
@@ -17,21 +15,21 @@ namespace :tmp do
17
15
  namespace :cache do
18
16
  # desc "Clears all files and directories in tmp/cache"
19
17
  task :clear do
20
- FileUtils.rm_rf(Dir['tmp/cache/[^.]*'])
18
+ rm_rf Dir['tmp/cache/[^.]*'], verbose: false
21
19
  end
22
20
  end
23
21
 
24
22
  namespace :sockets do
25
23
  # desc "Clears all files in tmp/sockets"
26
24
  task :clear do
27
- FileUtils.rm(Dir['tmp/sockets/[^.]*'])
25
+ rm Dir['tmp/sockets/[^.]*'], verbose: false
28
26
  end
29
27
  end
30
28
 
31
29
  namespace :pids do
32
30
  # desc "Clears all files in tmp/pids"
33
31
  task :clear do
34
- FileUtils.rm(Dir['tmp/pids/[^.]*'])
32
+ rm Dir['tmp/pids/[^.]*'], verbose: false
35
33
  end
36
34
  end
37
35
  end
@@ -54,7 +54,7 @@ module Minitest
54
54
 
55
55
  options[:color] = true
56
56
  options[:output_inline] = true
57
- options[:patterns] = opts.order!
57
+ options[:patterns] = defined?(@rake_patterns) ? @rake_patterns : opts.order!
58
58
  end
59
59
 
60
60
  # Running several Rake tasks in a single command would trip up the runner,
@@ -73,10 +73,7 @@ module Minitest
73
73
 
74
74
  ENV["RAILS_ENV"] = options[:environment] || "test"
75
75
 
76
- unless run_with_autorun
77
- patterns = defined?(@rake_patterns) ? @rake_patterns : options[:patterns]
78
- ::Rails::TestRequirer.require_files(patterns)
79
- end
76
+ ::Rails::TestRequirer.require_files(options[:patterns]) unless run_with_autorun
80
77
 
81
78
  unless options[:full_backtrace] || ENV["BACKTRACE"]
82
79
  # Plugin can run without Rails loaded, check before filtering.
@@ -84,14 +81,18 @@ module Minitest
84
81
  end
85
82
 
86
83
  # Replace progress reporter for colors.
87
- self.reporter.reporters.delete_if { |reporter| reporter.kind_of?(SummaryReporter) || reporter.kind_of?(ProgressReporter) }
88
- self.reporter << SuppressedSummaryReporter.new(options[:io], options)
89
- self.reporter << ::Rails::TestUnitReporter.new(options[:io], options)
84
+ reporter.reporters.delete_if { |reporter| reporter.kind_of?(SummaryReporter) || reporter.kind_of?(ProgressReporter) }
85
+ reporter << SuppressedSummaryReporter.new(options[:io], options)
86
+ reporter << ::Rails::TestUnitReporter.new(options[:io], options)
90
87
  end
91
88
 
92
89
  mattr_accessor(:run_with_autorun) { false }
93
90
  mattr_accessor(:run_with_rails_extension) { false }
94
91
  end
95
92
 
93
+ # Put Rails as the first plugin minitest initializes so other plugins
94
+ # can override or replace our default reporter setup.
95
+ # Since minitest only loads plugins if its extensions are empty we have
96
+ # to call `load_plugins` first.
96
97
  Minitest.load_plugins
97
- Minitest.extensions << 'rails'
98
+ Minitest.extensions.unshift 'rails'
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.beta3
4
+ version: 5.0.0.beta4
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-02-24 00:00:00.000000000 Z
11
+ date: 2016-04-27 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.beta3
19
+ version: 5.0.0.beta4
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.beta3
26
+ version: 5.0.0.beta4
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.beta3
33
+ version: 5.0.0.beta4
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.beta3
40
+ version: 5.0.0.beta4
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.beta3
95
+ version: 5.0.0.beta4
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.beta3
102
+ version: 5.0.0.beta4
103
103
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
104
104
  email: david@loudthinking.com
105
105
  executables:
@@ -127,7 +127,6 @@ files:
127
127
  - lib/rails/cli.rb
128
128
  - lib/rails/code_statistics.rb
129
129
  - lib/rails/code_statistics_calculator.rb
130
- - lib/rails/command.rb
131
130
  - lib/rails/commands.rb
132
131
  - lib/rails/commands/application.rb
133
132
  - lib/rails/commands/commands_tasks.rb
@@ -144,6 +143,7 @@ files:
144
143
  - lib/rails/configuration.rb
145
144
  - lib/rails/console/app.rb
146
145
  - lib/rails/console/helpers.rb
146
+ - lib/rails/dev_caching.rb
147
147
  - lib/rails/engine.rb
148
148
  - lib/rails/engine/commands.rb
149
149
  - lib/rails/engine/commands_tasks.rb
@@ -184,7 +184,7 @@ files:
184
184
  - lib/rails/generators/rails/app/templates/Rakefile
185
185
  - lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt
186
186
  - lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt
187
- - lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee
187
+ - lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js
188
188
  - lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css
189
189
  - lib/rails/generators/rails/app/templates/app/channels/application_cable/channel.rb
190
190
  - lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb
@@ -201,7 +201,7 @@ files:
201
201
  - lib/rails/generators/rails/app/templates/bin/rake
202
202
  - lib/rails/generators/rails/app/templates/bin/setup
203
203
  - lib/rails/generators/rails/app/templates/bin/update
204
- - lib/rails/generators/rails/app/templates/config.ru.tt
204
+ - lib/rails/generators/rails/app/templates/config.ru
205
205
  - lib/rails/generators/rails/app/templates/config/application.rb
206
206
  - lib/rails/generators/rails/app/templates/config/boot.rb
207
207
  - lib/rails/generators/rails/app/templates/config/cable.yml
@@ -233,11 +233,14 @@ files:
233
233
  - lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb
234
234
  - lib/rails/generators/rails/app/templates/config/initializers/request_forgery_protection.rb
235
235
  - lib/rails/generators/rails/app/templates/config/initializers/session_store.rb.tt
236
+ - lib/rails/generators/rails/app/templates/config/initializers/ssl_options.rb
237
+ - lib/rails/generators/rails/app/templates/config/initializers/to_time_preserves_timezone.rb
236
238
  - lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
237
239
  - lib/rails/generators/rails/app/templates/config/locales/en.yml
238
240
  - lib/rails/generators/rails/app/templates/config/puma.rb
239
241
  - lib/rails/generators/rails/app/templates/config/routes.rb
240
242
  - lib/rails/generators/rails/app/templates/config/secrets.yml
243
+ - lib/rails/generators/rails/app/templates/config/spring.rb
241
244
  - lib/rails/generators/rails/app/templates/db/seeds.rb.tt
242
245
  - lib/rails/generators/rails/app/templates/gitignore
243
246
  - lib/rails/generators/rails/app/templates/public/404.html
@@ -382,7 +385,7 @@ files:
382
385
  - lib/rails/test_unit/testing.rake
383
386
  - lib/rails/version.rb
384
387
  - lib/rails/welcome_controller.rb
385
- homepage: http://www.rubyonrails.org
388
+ homepage: http://rubyonrails.org
386
389
  licenses:
387
390
  - MIT
388
391
  metadata: {}
@@ -404,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
407
  version: 1.3.1
405
408
  requirements: []
406
409
  rubyforge_project:
407
- rubygems_version: 2.5.1
410
+ rubygems_version: 2.6.4
408
411
  signing_key:
409
412
  specification_version: 4
410
413
  summary: Tools for creating, working with, and running Rails applications.
@@ -1,70 +0,0 @@
1
- require 'rails/commands/commands_tasks'
2
-
3
- module Rails
4
- class Command #:nodoc:
5
- attr_reader :argv
6
-
7
- def initialize(argv = [])
8
- @argv = argv
9
-
10
- @option_parser = build_option_parser
11
- @options = {}
12
- end
13
-
14
- def self.run(task_name, argv)
15
- command_name = command_name_for(task_name)
16
-
17
- if command = command_for(command_name)
18
- command.new(argv).run(command_name)
19
- else
20
- Rails::CommandsTasks.new(argv).run_command!(task_name)
21
- end
22
- end
23
-
24
- def run(command_name)
25
- parse_options_for(command_name)
26
- @option_parser.parse! @argv
27
-
28
- public_send(command_name)
29
- end
30
-
31
- def self.options_for(command_name, &options_to_parse)
32
- @@command_options[command_name] = options_to_parse
33
- end
34
-
35
- def self.set_banner(command_name, banner)
36
- options_for(command_name) { |opts, _| opts.banner = banner }
37
- end
38
-
39
- private
40
- @@commands = []
41
- @@command_options = {}
42
-
43
- def parse_options_for(command_name)
44
- @@command_options.fetch(command_name, proc {}).call(@option_parser, @options)
45
- end
46
-
47
- def build_option_parser
48
- OptionParser.new do |opts|
49
- opts.on('-h', '--help', 'Show this help.') do
50
- puts opts
51
- exit
52
- end
53
- end
54
- end
55
-
56
- def self.inherited(command)
57
- @@commands << command
58
- end
59
-
60
- def self.command_name_for(task_name)
61
- task_name.gsub(':', '_').to_sym
62
- end
63
-
64
- def self.command_for(command_name)
65
- @@commands.find do |command|
66
- command.public_instance_methods.include?(command_name)
67
- end
68
- end
69
- end
70
- end
@@ -1,11 +0,0 @@
1
- # Action Cable provides the framework to deal with WebSockets in Rails.
2
- # You can generate new channels where WebSocket features live using the rails generate channel command.
3
- #
4
- # Turn on the cable connection by removing the comments after the require statements (and ensure it's also on in config/routes.rb).
5
- #
6
- #= require action_cable
7
- #= require_self
8
- #= require_tree ./channels
9
- #
10
- # @App ||= {}
11
- # App.cable = ActionCable.createConsumer()
@@ -1,10 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- <%- unless options[:skip_action_cable] -%>
5
-
6
- # Action Cable requires that all classes are loaded in advance
7
- Rails.application.eager_load!
8
- <%- end -%>
9
-
10
- run Rails.application