From 1a5941e3cfb67056a9468d590f8ae03485f75ccc Mon Sep 17 00:00:00 2001 From: claudiob Date: Sat, 20 Feb 2016 09:56:35 -0800 Subject: AppGenerator: Replace 'rake' with 'rails_command' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since Rails 5.0 is switching the Rails command line from 'rake …' to 'rails …', it makes sense to also replace the `rake` method in the Rails templates API. Based on feedback from @matthewd and @kaspth, I chose to replace `rake` with `rails_command`, which is less confusing than the alternatives `rails` or `command` or `rails_run` and is not Thor-reserved word like `task`. --- railties/lib/rails/generators/actions.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index 9ca731347a..bd7f3f2c6b 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -218,6 +218,7 @@ module Rails sudo = options[:sudo] && RbConfig::CONFIG['host_os'] !~ /mswin|mingw/ ? 'sudo ' : '' in_root { run("#{sudo}#{extify(:rake)} #{command} RAILS_ENV=#{env}", verbose: false) } end + alias :rails_command :rake # Just run the capify command in root # -- cgit v1.2.3