Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Make template path available in TemplateRunner

#3081

Currently TemplateRunner only sets an instance variable for @root, giving the path to the rails app being created. It would be nice if the template variable was also exposed as an instance variable. This way in the event that you have some static resources that you want to put into your new app, they're easy to get to.

Right now the only way to get to that information is through $*, and best guess that you have the right index.

Reported by Steve · August 20th, 2009 @ 08:37 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to invalid

    You can just refer to the template within your template as template (wow, clear as mud)...here's a bit of code where I grab a config file that's sitting in the same folder as the template:

    template_path = File.expand_path(File.dirname(template), File.join(root,'..'))
    config_file = File.join(template_path, "config.yml")
    

    Somewhat convoluted to ensure it works whether the templaet is specified by relative or absolute path when it's invoked.

    If this isn't what you're after, feel free to reopen with more information.

    August 20th, 2009 @ 11:04 AM