Skip to content
This repository
Browse code

Fix rake rails:template to tell user to pass LOCATION variable.

  • Loading branch information...
commit edfcf47026e408276684237e9e3d49aa4cf3f755 1 parent eead13f
Arun Agrawal authored July 25, 2011

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  railties/lib/rails/tasks/framework.rake
6  railties/lib/rails/tasks/framework.rake
@@ -19,14 +19,14 @@ namespace :rails do
19 19
   desc "Update both configs and public/javascripts from Rails (or use just update:javascripts or update:configs)"
20 20
   task :update => [ "update:configs", "update:javascripts", "update:scripts", "update:application_controller" ]
21 21
 
22  
-  desc "Applies the template supplied by LOCATION=/path/to/template"
  22
+  desc "Applies the template supplied by LOCATION=(/path/to/template) or URL"
23 23
   task :template do
24 24
     template = ENV["LOCATION"]
  25
+    raise "No LOCATION value given. Please set LOCATION either as path to a file or a URL" if template.blank?
25 26
     template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
26  
-
27 27
     require 'rails/generators'
28 28
     require 'rails/generators/rails/app/app_generator'
29  
-    generator = Rails::Generators::AppGenerator.new [ Rails.root ], {}, :destination_root => Rails.root
  29
+    generator = Rails::Generators::AppGenerator.new [Rails.root], {}, :destination_root => Rails.root
30 30
     generator.apply template, :verbose => false
31 31
   end
32 32
 

0 notes on commit edfcf47

Please sign in to comment.
Something went wrong with that request. Please try again.