academia-edu/bunch — pull request #2 by jure (2012-07-12 20:35:41+00:00)
Title: Add ejs support

This is to add .ejs.jst templates support to bunch. It's not finished but I'm putting it up for discussion.

Basically there are two remaining issues. One is what to do with namespacing. I'm using object literals now, but I guess there are other ways.

Sprockets basically does the same, unless I'm missing something:
https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/jst_processor.rb#L9-L25

The other issue is the template_name (which is used than as JST['template_name'] in JS), which I'm now hacking together to be sensible for the current project I'm working on.

```
def template_name
@filename.gsub('app/scripts/','').gsub('.jst.ejs','').gsub('/templates', '')
end
```

Which just means that ```app/scripts/reports/templates/view.jst.ejs``` becomes ```reports/view```

But obviously that is not easily transferrable to other projects.