Closed dmitry-solomadin closed 11 years ago
Can you post a fuller example and help me understand how this differs from #9? Thanks!
Closing this, I added some tests for absolute includes in v0.2.2
and I couldn't reproduce your issue. Please re-open if you're still experiencing this problem!
Hi,
Please reopen issue. First of all I tried to run tests and 7 of them fail with 500 error, the only common thing between those 7 test is call for "include" function. I tried to run test on pure install.
Second. Your absolute include test is a bit wrong. You are trying to include partial with absolute path from the root folder and it of course should pass. Just place "with-absolute-include.ejs" into "subfolder" and try to run the test again it would fail because it would look for "locals" partial not from "root/locals" but from "root/subfolder/locals".
Sorry, I cannot write real test because as I stated tests are already failing for me.
Hmm - it sounds ba that the tests don't work at all. Let's fix that first.
Can you paste the results of npm test
and npm ls
? And the version of
node are you using? And what platform?
Here is npm test
— http://pastebin.com/n9xUgVqw
Here is npm ls
— http://pastebin.com/H8A7UVCm
I use mac os x mountain lion, node version is v0.8.7
I have the same issue. Any updates on it?
I use Linux x86_64 and node v0.8.9
Sorry for delayed response on this thread. I've re-opened the issue so I don't forget to take a look at why the tests fail, but I haven't figured it out yet.
Did you install from npm, or from git clone?
I have npm installation.
I tried both.
For those still following along with this issue: I just tested with a fresh download of ejs-locals and I'm getting the same errors with the tests. Hopefully I can figure that out this evening.
AHA.
EJS itself now has include
functionality which unfortunately overrides the include
function in ejs-locals
. This means that EJS can now compose templates by itself which is great.
It also means that the include
functionality in ejs-locals
should be removed. Will do.
Closing this. I have removed include
from ejs-locals
. You should be able to use include
from EJS itself now, and it should be better tested/maintained.
It is very common behaviour that when we use following code:
the include function should start search for script in /APP_ROOT/folder/script currently instead of application root it uses current folder.