Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Do not use File.directory? method when resolving template #2

Closed
ggrossetie opened this issue Sep 29, 2016 · 1 comment
Closed

Do not use File.directory? method when resolving template #2

ggrossetie opened this issue Sep 29, 2016 · 1 comment

Comments

@ggrossetie
Copy link
Member

Browsers are unable to implement this method and therefore resolve_template method will always returns nil.

I think we should try to read template files at:

  • "#{template_dir}/#{name}.#{engine}"
  • "#{template_dir}/#{engine}/#{name}.#{engine}"
  • "#{template_dir}/#{backend}/#{name}.#{engine}"
  • "#{template_dir}/#{engine}/#{backend}/#{name}.#{engine}"

using only File.exist?.

@mojavelinux
Copy link
Member

I'd even suggest that we make it more restrictive. Let's look for the template at exactly one place and just get people to adhere to that. I think we should just assume the template directory points to where the templates are and not try to go deeper (so the first location). That design was intended more for the Ruby side where you are toggling backends, template engines, and such.

ggrossetie added a commit that referenced this issue Oct 2, 2016
Resolves #2, Use a simpler implementation to read templates
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants