aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRaghunadh <rdoddaka@crri.co.in>2011-07-23 14:37:25 +0530
committerRaghunadh <raghunadhd@gmail.com>2011-07-23 20:52:53 +0530
commite9f16256ba11544823096000d7f78c93755c787d (patch)
tree3f6aeac20b0178faeaa840100c5c1320604d1755 /railties
parent94978b9a46173b875bcb0d5cb724e5119e4aa8f4 (diff)
downloadrails-e9f16256ba11544823096000d7f78c93755c787d.tar.gz
rails-e9f16256ba11544823096000d7f78c93755c787d.tar.bz2
rails-e9f16256ba11544823096000d7f78c93755c787d.zip
Improve rails:template undefined LOCATION variable error message fixed
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/tasks/framework.rake6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake
index 77a5c4dc6c..206ce39773 100644
--- a/railties/lib/rails/tasks/framework.rake
+++ b/railties/lib/rails/tasks/framework.rake
@@ -2,14 +2,14 @@ namespace :rails do
desc "Update configs and some other initially generated files (or use just update:configs, update:scripts, or update:application_controller)"
task :update => [ "update:configs", "update:scripts", "update:application_controller" ]
- desc "Applies the template supplied by LOCATION=/path/to/template"
+ desc "Applies the template supplied by LOCATION=(/path/to/template) or URL"
task :template do
template = ENV["LOCATION"]
+ raise "No LOCATION value given. Please set LOCATION either as path to a file or a URL" if template.blank?
template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
-
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
- generator = Rails::Generators::AppGenerator.new [ Rails.root ], {}, :destination_root => Rails.root
+ generator = Rails::Generators::AppGenerator.new [Rails.root], {}, :destination_root => Rails.root
generator.apply template, :verbose => false
end