aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/generators/applications/app/app_generator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/generators/applications/app/app_generator.rb')
-rw-r--r--railties/lib/rails_generator/generators/applications/app/app_generator.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
index 4bb94ff96d..4a191578cf 100644
--- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb
+++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -1,4 +1,5 @@
require 'rbconfig'
+require File.dirname(__FILE__) + '/template_runner'
require 'digest/md5'
require 'active_support/secure_random'
@@ -37,6 +38,12 @@ class AppGenerator < Rails::Generator::Base
end
end
+ def after_generate
+ if options[:template]
+ Rails::TemplateRunner.new(@destination_root, options[:template])
+ end
+ end
+
protected
def banner
"Usage: #{$0} /path/to/your/app [options]"
@@ -60,6 +67,11 @@ class AppGenerator < Rails::Generator::Base
opt.on("-f", "--freeze",
"Freeze Rails in vendor/rails from the gems generating the skeleton",
"Default: false") { |v| options[:freeze] = v }
+
+ opt.on("-m", "--template=path", String,
+ "Use an application template that lives at path (can be a filesystem path or URL).",
+ "Default: (none)") { |v| options[:template] = v }
+
end