From 7047159a856542f4d827a8cd68719025b1003956 Mon Sep 17 00:00:00 2001 From: Christopher Giroir Date: Fri, 31 Oct 2014 09:21:14 -0700 Subject: [PATCH] Forcing docs to use the cwd as file base --- lib/parser.js | 6 ++++-- test/expected/hello.txt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/parser.js b/lib/parser.js index be0ab18..f99df2f 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -29,10 +29,12 @@ // Accumulate files this.parse = function(vinyl){ var data = vinyl.contents.toString('utf8'); + + vinyl.base = vinyl.cwd; // Don't treat empty files if (data.length){ - filemap[vinyl.path] = data; - dirmap[vinyl.path] = vinyl.cwd; + filemap[vinyl.relative] = data; + dirmap[vinyl.relative] = vinyl.cwd; } }; diff --git a/test/expected/hello.txt b/test/expected/hello.txt index 6903f79..d6acf34 100644 --- a/test/expected/hello.txt +++ b/test/expected/hello.txt @@ -1 +1 @@ -{"project":{},"files":{"test/fixtures/hello.txt":{"name":"test/fixtures/hello.txt","modules":{"fixture":1},"classes":{},"fors":{},"namespaces":{}}},"modules":{"fixture":{"name":"fixture","submodules":{},"classes":{},"fors":{},"namespaces":{},"tag":"module","file":"test/fixtures/hello.txt","line":1}},"classes":{},"classitems":[],"warnings":[]} \ No newline at end of file +{"project":{},"files":{"fixtures/hello.txt":{"name":"fixtures/hello.txt","modules":{"fixture":1},"classes":{},"fors":{},"namespaces":{}}},"modules":{"fixture":{"name":"fixture","submodules":{},"classes":{},"fors":{},"namespaces":{},"tag":"module","file":"fixtures/hello.txt","line":1}},"classes":{},"classitems":[],"warnings":[]} \ No newline at end of file