public
Description: Rake extension for generating and updating projects from templates
Homepage:
Clone URL: git://github.com/automatthew/rakegen.git
automatthew (author)
Mon Sep 01 10:46:58 -0700 2008
commit  1cdf1606935d6c231b251d84c38b15b4544e9855
tree    e554f6de215001d27a6875a0c222a1440ccdf492
parent  73048835e4744ebe7e62bd56e58798dd39e4d9e1
name age message
file CHANGELOG Loading commit data...
file LICENSE
file Manifest
file README
file Rakefile
directory lib/
file rakegen.gemspec
directory test/
README
= Rakegen

Rakegen is a Rake extension for generating and updating projects from templates.  Give Rakegen a source and a target, 
and it creates a rake task that will make the necessary directories and copy the template files to the target.  Rakegen 
processes .erb files by default, but you can register a template processing lambda for any file extension.  Because 
Rakegen is Rake-based, you can add your own dependencies and actions to any target file.

== Usage

  generator = Rakegen.new("generate:app") do |gen|
    gen.source = "templates/application"
    gen.target = "/Users/matthew/dev/waves/thingy"
    gen.excludes << "**/*.yaml"
    gen.template_assigns = {:application_name => "thingy"}
    gen.executables = %w{ bin/waves-console  bin/waves-server }
  end
  
This will define a task named, naturally enough, "generate:app".  You can invoke it in the usual way, with <tt>rake 
generate_app</tt>, or you can call it from Ruby:

  Rake::Task["generate:app"].invoke
  
At the moment, Rakegen happily clobbers any copyable files with mod dates older than the associated template file.  
Files produced by template processing always get clobbered.  Soon to come is a more courteous file task that asks if you 
want to clobber or skip.