coffeedoc / codo

CoffeeScript API documentation generator. It's like YARD but for CoffeeScript!
Other
624 stars 92 forks source link

Codo doesn't like folders with 'coffee' in the name? #47

Closed tcql closed 12 years ago

tcql commented 12 years ago

When trying to document a file 'Handler.coffee' inside of a folder named 'coffeescripts', Codo returns

Cannot Parse file coffeescripts/Handler.coffee: ENOENT, no such file or directory 'escripts/Handler.coffee'
netzpirat commented 12 years ago

I've just tested to create the documentation for a file in a directory named coffeescripts, both at the root of the project and nested within a src directory and it works fine.

Can you please run codo with the the debug option (--debug or -d) and post the stack trace? What are your command line args and/or .codoopts content?

netzpirat commented 12 years ago

Closing since lack of response. Please reopen if issue still exists and you're interested in solving it.

lluchs commented 11 years ago

I've got the same issue. Output without --debug:

$ codo ../../../libs/one-common/src/main/coffee
Cannot parse file /<path>/src/main/coffee/org/oneandone/one/strings/en.coffee: ENOENT, no such file or directory 'c/main/coffee/org/oneandone/one/strings/en.coffee'                          
[...]

Output with --debug:

$ codo --debug ../../../libs/one-common/src/main/coffee                     

/usr/local/lib/node_modules/codo/src/codo.coffee:167                                                    
                          throw error;                                                                  
                                ^                                                                       
Error: ENOENT, no such file or directory 'c/main/coffee/org/oneandone/one/strings/en.coffee'            
    at Object.fs.openSync (fs.js:338:18)                                                                
    at Object.fs.readFileSync (fs.js:182:15)                                                            
    at Parser.module.exports.Parser.parseFile (/usr/local/lib/node_modules/codo/src/parser.coffee:31:28)
    at module.exports.Codo.run (/usr/local/lib/node_modules/codo/src/codo.coffee:164:32)                
    at async.parallel (/usr/local/lib/node_modules/codo/node_modules/async/lib/async.js:476:17)         
    at async.forEach (/usr/local/lib/node_modules/codo/node_modules/async/lib/async.js:94:25)           
    at async.parallel (/usr/local/lib/node_modules/codo/node_modules/async/lib/async.js:473:21)         
    at module.exports.Codo.detectExtras (/usr/local/lib/node_modules/codo/src/codo.coffee:230:16)       
    at _filter (/usr/local/lib/node_modules/codo/node_modules/async/lib/async.js:236:13)                
    at async.forEach (/usr/local/lib/node_modules/codo/node_modules/async/lib/async.js:94:25)           
lluchs commented 11 years ago

Ah, I guess it's not because of 'coffee', but because the path given isn't in a subdirectory. The error is probably thrown there: https://github.com/netzpirat/codo/blob/v1.5.3/src/codo.coffee#L194

netzpirat commented 11 years ago

You need to compile it from your project root, as Codo tries to read the codo options file .codoopts or tries to guess some projects settings if not found or specified.