Permalink
Browse files

Merge pull request #2235 from arunagw/location_var_fix_cherry-pick

Location var fix cherry pick from master to 3-1-stable
  • Loading branch information...
2 parents 5b88219 + fb6a76c commit b2eaf968de405ab4b5c5fb868efbb6d812779ff1 @spastorino spastorino committed Jul 24, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/lib/rails/tasks/framework.rake
View
6 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

0 comments on commit b2eaf96

Please sign in to comment.