aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorRyo Hashimoto <ryohashimoto@gmail.com>2016-02-13 14:14:23 +0900
committerRyo Hashimoto <ryohashimoto@gmail.com>2016-02-26 19:35:23 +0900
commiteaec958630ea53cddb84ef4746b23bcd917ba45d (patch)
tree32332447110640ccf548c9e839c99014f62e65e9 /railties/lib/rails
parent56ca2061df83a307943a0ffdfe6f5f4ed5846cf7 (diff)
downloadrails-eaec958630ea53cddb84ef4746b23bcd917ba45d.tar.gz
rails-eaec958630ea53cddb84ef4746b23bcd917ba45d.tar.bz2
rails-eaec958630ea53cddb84ef4746b23bcd917ba45d.zip
The tasks in the rails task namespace is deprecated in favor of app namespace.
(e.g. `rails:update` and `rails:template` tasks is renamed to `app:update` and `app:template`.)
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/app_loader.rb2
-rw-r--r--railties/lib/rails/tasks/framework.rake16
2 files changed, 16 insertions, 2 deletions
diff --git a/railties/lib/rails/app_loader.rb b/railties/lib/rails/app_loader.rb
index a9fe21824e..af004d85bf 100644
--- a/railties/lib/rails/app_loader.rb
+++ b/railties/lib/rails/app_loader.rb
@@ -16,7 +16,7 @@ like any other source code, rather than stubs that are generated on demand.
Here's how to upgrade:
bundle config --delete bin # Turn off Bundler's stub generator
- rake rails:update:bin # Use the new Rails 4 executables
+ rails app:update:bin # Use the new Rails 5 executables
git add bin # Add bin/ to source control
You may need to remove bin/ from your .gitignore as well.
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake
index 7601836809..ae92836407 100644
--- a/railties/lib/rails/tasks/framework.rake
+++ b/railties/lib/rails/tasks/framework.rake
@@ -1,4 +1,6 @@
-namespace :rails do
+require 'active_support/deprecation'
+
+namespace :app do
desc "Update configs and some other initially generated files (or use just update:configs or update:bin)"
task update: [ "update:configs", "update:bin" ]
@@ -66,3 +68,15 @@ namespace :rails do
end
end
end
+
+namespace :rails do
+ %i(update template templates:copy update:configs update:bin).each do |task_name|
+ task "#{task_name}" do
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ Running #{task_name} with the rails: namespace is deprecated in favor of app.
+ Run e.g. bin/rails app:#{task_name} instead."
+ MSG
+ Rake.application.invoke_task("app:#{task_name}")
+ end
+ end
+end