Permalink
Browse files

fixing docco to use console.log instead of puts and print

  • Loading branch information...
1 parent 7988b42 commit 6913324e978b074eb8e9d43a13d87879af4735b6 @jashkenas jashkenas committed Nov 9, 2010
Showing with 30 additions and 34 deletions.
  1. +2 −2 Cakefile
  2. +26 −29 lib/docco.js
  3. +2 −3 src/docco.coffee
View
@@ -4,7 +4,7 @@ option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
task 'build', 'build the docco library', ->
coffee = spawn 'coffee', ['-cw', '-o', 'lib', 'src']
- coffee.stdout.on 'data', (data) -> print data.toString()
+ coffee.stdout.on 'data', (data) -> console.log data.toString().trim()
task 'install', 'install the `docco` command into /usr/local (or --prefix)', (options) ->
base = options.prefix or '/usr/local'
@@ -14,7 +14,7 @@ task 'install', 'install the `docco` command into /usr/local (or --prefix)', (op
'cp -rf bin README resources vendor docco.coffee ' + lib
'ln -sf ' + lib + '/bin/docco ' + base + '/bin/docco'
].join(' && '), (err, stdout, stderr) ->
- if err then print stderr
+ if err then console.error stderr
)
task 'doc', 'rebuild the Docco documentation', ->
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -84,7 +84,7 @@ highlight = (source, sections, callback) ->
pygments = spawn 'pygmentize', ['-l', language.name, '-f', 'html', '-O', 'encoding=utf-8']
output = ''
pygments.stderr.addListener 'data', (error) ->
- puts error if error
+ console.error error if error
pygments.stdout.addListener 'data', (result) ->
output += result if result
pygments.addListener 'exit', ->
@@ -106,7 +106,7 @@ generate_html = (source, sections) ->
html = docco_template {
title: title, sections: sections, sources: sources, path: path, destination: destination
}
- puts "docco: #{source} -> #{dest}"
+ console.log "docco: #{source} -> #{dest}"
fs.writeFile dest, html
#### Helpers & Setup
@@ -117,7 +117,6 @@ fs = require 'fs'
path = require 'path'
showdown = require('./../vendor/showdown').Showdown
{spawn, exec} = require 'child_process'
-{puts, print} = require 'sys'
# A list of the languages that Docco supports, mapping the file extension to
# the name of the Pygments lexer and the symbol that indicates a comment. To

0 comments on commit 6913324

Please sign in to comment.