提交 7d56fd9f 编写于 作者: J José Valim

Always use application generator to run templates.

上级 d9aae2b5
......@@ -176,7 +176,6 @@ def freeze?
protected
# Define file as an alias to create_file for backwards compatibility.
# TODO Add deprecation warning?
#
def file(*args, &block)
create_file(*args, &block)
......
......@@ -86,7 +86,7 @@ namespace :rails do
template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
require 'generators'
generator = Rails::Generators::Base.new [], {}, :destination_root => RAILS_ROOT
generator = Rails::Generators::App.new [ RAILS_ROOT ], {}, :destination_root => RAILS_ROOT
generator.apply template, :verbose => false
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册