Skip to content

Commit

Permalink
fixing docco to use console.log instead of puts and print
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Nov 9, 2010
1 parent 7988b42 commit 6913324
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 34 deletions.
4 changes: 2 additions & 2 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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', ->
Expand Down
55 changes: 26 additions & 29 deletions lib/docco.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/docco.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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', ->
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6913324

Please sign in to comment.