dshadowwolf/config-general — pull request #1 by flimzy (2014-09-27 01:56:07+00:00)
Title: Fix handling of ConfigPath + IncludeRelative

This fixes some bugs I discovered when, amazingly, porting a Perl application to node.js. Specifically, the path being searched with ConfigPath + IncludeRelative was being calculated incorrectly. My PR accomplishes:

- Moves some logic in cg_parser.js into a new sub, for easier testing.
- Add tests to cover my changes. The last two test blocks in 33-generate-flist.js were failing prior to my change, and now are passing.
- I fixed the core bug by simplifying the logic in (what is now) generate_flist() instead of the more complex (and buggy) getRelative() in file-utils.js
- We now properly search the path of the file being read *first*, and then consult ConfigPath, to retain compatibility with Config::General from Perl
- Strip trailing slashes from directory names before appending '/' + file name. This is mostly just to be prettier, as "/etc//foo" doesn't cause an error (at least not on most Unix OSes--it might on some platforms)