aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-07-23 08:26:16 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-07-23 08:26:16 -0700
commit35c87a139aa43c37fad018ef87fe5c2939a3b580 (patch)
tree96f0fa93e7443c30ccfe27868dc4edd794cf2700 /railties/lib/rails
parent7dadb6aa0a65ff9ecd4b67d0686ab609fb9465ae (diff)
parente9f16256ba11544823096000d7f78c93755c787d (diff)
downloadrails-35c87a139aa43c37fad018ef87fe5c2939a3b580.tar.gz
rails-35c87a139aa43c37fad018ef87fe5c2939a3b580.tar.bz2
rails-35c87a139aa43c37fad018ef87fe5c2939a3b580.zip
Merge pull request #2198 from Karunakar/fixing_2168
Improve rails:template undefined LOCATION variable error message fixed
Diffstat (limited to 'railties/lib/rails')
-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