<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *2.3.0 [Edge]*
 
+* Add a rake task to apply a template to an existing application : rake rails:template LOCATION=~/template.rb [Pratik]
+
 * Add &quot;-m/--template&quot; option to Rails generator to apply a template to the generated application. [Jeremy McAnally]
 
     This has been extracted from rg - http://github.com/jeremymcanally/rg</diff>
      <filename>railties/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ class AppGenerator &lt; Rails::Generator::Base
 
   def after_generate
     if options[:template]
-      Rails::TemplateRunner.new(@destination_root, options[:template])
+      Rails::TemplateRunner.new(options[:template], @destination_root)
     end
   end
 </diff>
      <filename>railties/lib/rails_generator/generators/applications/app/app_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,8 @@ module Rails
   class TemplateRunner
     attr_reader :root
 
-    def initialize(root, template) # :nodoc:
-      @root = Dir.pwd + &quot;/&quot; + root
+    def initialize(template, root = '') # :nodoc:
+      @root = File.join(Dir.pwd, root)
 
       puts &quot;applying template: #{template}&quot;
 </diff>
      <filename>railties/lib/rails_generator/generators/applications/app/template_runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -80,6 +80,12 @@ namespace :rails do
   desc &quot;Update both configs, scripts and public/javascripts from Rails&quot;
   task :update =&gt; [ &quot;update:scripts&quot;, &quot;update:javascripts&quot;, &quot;update:configs&quot;, &quot;update:application_controller&quot; ]
 
+  desc &quot;Applies the template supplied by LOCATION=/path/to/template&quot;
+  task :template do
+    require 'rails_generator/generators/applications/app/template_runner'
+    Rails::TemplateRunner.new(ENV[&quot;LOCATION&quot;])
+  end
+
   namespace :update do
     desc &quot;Add new scripts to the application script/ directory&quot;
     task :scripts do</diff>
      <filename>railties/lib/tasks/framework.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2dc5d12c91d0c717f7bac6b544193e810ce4917a</id>
    </parent>
  </parents>
  <author>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/f7f113610e7cdca8ef03e206f2cbeb8400cdfefa</url>
  <id>f7f113610e7cdca8ef03e206f2cbeb8400cdfefa</id>
  <committed-date>2008-12-06T18:40:23-08:00</committed-date>
  <authored-date>2008-12-06T18:40:23-08:00</authored-date>
  <message>Add a rake task to apply a template to an existing application.

Example : rake rails:template LOCATION=~/template.rb</message>
  <tree>8d8a75ebb9e096b15dc759ff6e94856f70854203</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
