joshbuddy / dressmaker

Application templating in ruby. Define beautiful patterns and cut them out.

This URL has Read+Write access

name age message
file README.rdoc Fri Nov 20 10:15:12 -0800 2009 fixed readme [Joshua Hull]
file Rakefile Wed Nov 18 18:56:48 -0800 2009 added append [Joshua Hull]
file VERSION Wed Nov 18 18:58:42 -0800 2009 Version bump to 0.0.3 [Joshua Hull]
directory bin/ Mon Nov 16 17:36:55 -0800 2009 added bin, missing tasks [Joshua Hull]
file dressmaker.gemspec Tue Dec 01 11:26:12 -0800 2009 Regenerated gemspec for version 0.0.3 [Joshua Hull]
directory lib/ Wed Nov 18 18:56:48 -0800 2009 added append [Joshua Hull]
directory spec/ Wed Nov 18 18:56:48 -0800 2009 added append [Joshua Hull]
README.rdoc

Dressmaker

Beautiful templating

I wanted to do really simple application templating, and found Rubigen and Thor were both tied to a command-line interface paradigm, whereas I really just wanted to execute this stuff programmatically. I also wanted application templates to be entirely self-contained.

Usage

Inside your application

  require 'dressmaker'

  maker = Dressmaker.new('my-template', 'my-source')
  maker.generate

And you’re done! If you need to pass in options at generate time, simply pass generate some options.

  maker.generate(:database => 'mysql')

Inside the template directory is a file, called Pattern. Here is a typical Pattern:

  desc "make executable"
  directory.matches('/bin') do |dir|
    dir.all { |f|
      f.make_executable!
    }
  end

This would make everything inside bin executable.

Caution!

Everything here is subject to change. This is just an egg of an idea.