In Sinatra, the file argument passed to a Tilt Template is usually a path to the calling Ruby file, not the name of the template file. This makes it impossible to reuse the filename when outputting the compiled template. For example, when precompiling Handlebars templates it would be nice to be able to automatically namespace them in JavaScript based on their filename. This change adds an option to pass the filename.
In Sinatra, the file argument passed to a Tilt Template is usually a path to the calling Ruby file, not the name of the template file. This makes it impossible to reuse the filename when outputting the compiled template. For example, when precompiling Handlebars templates it would be nice to be able to automatically namespace them in JavaScript based on their filename. This change adds an option to pass the filename.