[LA.pm] What to call a small module

Ben Tilly btilly at gmail.com
Mon Apr 30 18:47:20 PDT 2012


I have a small module, I just don't know what to call it.  Does anyone
have any suggestions?

It just takes a hash, and expands it as a template, with the variables
referring to other keys.  It can even handle nested hashes.  So you
might pass it something like this:

  {
    user => 'btilly',
    project_root => '/home/[% user %]/foo',
    template_root => '[% project_root %]/app/view',
    escaped => '\[% watch_this %]',
  }

and then get back:

  {
    user => 'btilly',
    project_root => '/home/btilly/foo',
    template_root => '/home/btilly/foo//app/view',
    escaped => '[% watch_this %]',
  }

The use case is mostly for configuration files, where you'd have a
hash describing a basic sandbox template, override the values you need
to, and then get the configuration for a developer.  With this sort of
templating, the amount that you need to override goes way down.


More information about the Losangeles-pm mailing list