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

Resolves #2, Use a simpler implementation to read templates #3

Merged
merged 1 commit into from
Oct 2, 2016

Conversation

ggrossetie
Copy link
Member

Replace File.exists and File.directory? with File.read because they are not available in a browser environment.
Also narrow down the number of locations where we were looking for templates:

  • #{template_dir}/#{name}.jade
  • #{template_dir}/jade/#{name}.jade

Replace File.exists and File.directory? with File.read because they are not available in a browser environment.
Also narrow down the number of locations where we were looking for templates:

 - #{template_dir}/#{name}.jade
 - #{template_dir}/jade/#{name}.jade
::File.read(name)
rescue IOError
# Ignore error as Asciidoctor expect a nil value if the template is not found
nil
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mojavelinux Could you please confirm that's this is the correct way to do it ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@ggrossetie ggrossetie merged commit cc656a2 into master Oct 2, 2016
@ggrossetie ggrossetie deleted the issue-2 branch October 2, 2016 17:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants