Permalink
Browse files

replaced file paths with path.joins for full compatibility

  • Loading branch information...
1 parent 41d474d commit 9a18bf4973e5be4f24ea4aa57b6812bf678b091c @neocotic neocotic committed Mar 29, 2013
Showing with 15 additions and 15 deletions.
  1. +8 −8 docco.js
  2. +7 −7 docco.litcoffee
View
@@ -136,7 +136,7 @@
config = {
layout: 'parallel',
- output: 'docs/',
+ output: 'docs',
template: null,
css: null,
extension: null
@@ -149,12 +149,12 @@
if (options.template) {
config.layout = null;
} else {
- dir = config.layout = "" + __dirname + "/resources/" + config.layout;
- if (fs.existsSync("" + dir + "/public")) {
- config["public"] = "" + dir + "/public";
+ dir = config.layout = path.join(__dirname, 'resources', config.layout);
+ if (fs.existsSync(path.join(dir, 'public'))) {
+ config["public"] = path.join(dir, 'public');
}
- config.template = "" + dir + "/docco.jst";
- config.css = options.css || ("" + dir + "/docco.css");
+ config.template = path.join(dir, 'docco.jst');
+ config.css = options.css || path.join(dir, 'docco.css');
}
config.template = _.template(fs.readFileSync(config.template).toString());
return config.sources = options.args.filter(function(source) {
@@ -180,7 +180,7 @@
highlight = require('highlight.js').highlight;
- languages = JSON.parse(fs.readFileSync("" + __dirname + "/resources/languages.json"));
+ languages = JSON.parse(fs.readFileSync(path.join(__dirname, 'resources', 'languages.json')));
for (ext in languages) {
l = languages[ext];
@@ -204,7 +204,7 @@
return lang;
};
- version = JSON.parse(fs.readFileSync("" + __dirname + "/package.json")).version;
+ version = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'))).version;
run = function(args) {
var c;
View
@@ -192,7 +192,7 @@ options.
config =
layout: 'parallel'
- output: 'docs/'
+ output: 'docs'
template: null
css: null
extension: null
@@ -207,10 +207,10 @@ source files for languages for which we have definitions.
if options.template
config.layout = null
else
- dir = config.layout = "#{__dirname}/resources/#{config.layout}"
- config.public = "#{dir}/public" if fs.existsSync "#{dir}/public"
- config.template = "#{dir}/docco.jst"
- config.css = options.css or "#{dir}/docco.css"
+ dir = config.layout = path.join __dirname, 'resources', config.layout
+ config.public = path.join dir, 'public' if fs.existsSync path.join dir, 'public'
+ config.template = path.join dir, 'docco.jst'
+ config.css = options.css or path.join dir, 'docco.css'
config.template = _.template fs.readFileSync(config.template).toString()
config.sources = options.args.filter((source) ->
@@ -237,7 +237,7 @@ Each item maps the file extension to the name of the language and the
`symbol` that indicates a line comment. To add support for a new programming
language to Docco, just add it to the file.
- languages = JSON.parse fs.readFileSync("#{__dirname}/resources/languages.json")
+ languages = JSON.parse fs.readFileSync(path.join(__dirname, 'resources', 'languages.json'))
Build out the appropriate matchers and delimiters for each language.
@@ -265,7 +265,7 @@ file extension. Detect and tag "literate" `.ext.md` variants.
Keep it DRY. Extract the docco **version** from `package.json`
- version = JSON.parse(fs.readFileSync("#{__dirname}/package.json")).version
+ version = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'))).version
Command Line Interface

0 comments on commit 9a18bf4

Please sign in to comment.