Get the path within a template (as in Rails template, not view template)

Hi guys. In one of my Rails templates (the type of template that you pass to "rails -m template.rb"), I'm trying to determine the path of the template.

I've checked for instance variables from within the template, but only @root and @logger exist.

Is there a way for the template to determine its path, or at least which directory it's located in?

Thanks! Nick

Is there a way for the template to determine its path, or at least which directory it's located in?

Can you use __FILE__? Or File.dirname(__FILE__) if you just want the directory?

Best, Steve

Unfortunately not. It seems the template is pushed through #eval. This:     puts "file = [#{__FILE__.inspect}]" outputs this:     file = ["(eval)"]