Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit edfcf47026e408276684237e9e3d49aa4cf3f755 1 parent eead13f
@arunagw arunagw authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/lib/rails/tasks/framework.rake
View
6 railties/lib/rails/tasks/framework.rake
@@ -19,14 +19,14 @@ namespace :rails do
desc "Update both configs and public/javascripts from Rails (or use just update:javascripts or update:configs)"
task :update => [ "update:configs", "update:javascripts", "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
Please sign in to comment.
Something went wrong with that request. Please try again.