#121 ✓wontfix
Simon Rozet

Refactor the installer to use Templater

Reported by Simon Rozet | March 19th, 2009 @ 09:17 PM

http://github.com/jnicklas/templater/tree/master

module MyGenerators

  extend Templater::Manifold

  class BlogGenerator < Templater::Generator
    # directory this generator uses as source root when searching
    # for files, directories, templates
    def self.source_root
      File.join(File.dirname(__FILE__), 'templates')
    end

    # uses blog.rbt template (note conventional trailing t)
    # placing resulting file to blog.rb relatively to
    # destination root
    template :blog, 'blog.rb'

    # does simple copy of me.jpg placing resulting file to me.jpg relatively to
    # destination root
    file :me, 'me.jpg'

    # creates empty directory public/javascripts relatively to
    # destination root
    empty_directory :javascripts, File.join("public", "javascripts")
  end
end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Automated continuous integration server that doesn't suck.

Shared Ticket Bins

People watching this ticket

Pages