mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixing api changes (no more promises) for node v.0.1.29
This commit is contained in:
parent
08539a156e
commit
9503ea3040
5 changed files with 9 additions and 9 deletions
6
Cakefile
6
Cakefile
|
@ -17,7 +17,7 @@ task 'install', 'install CoffeeScript into /usr/local', ->
|
||||||
|
|
||||||
|
|
||||||
task 'build', 'build the CoffeeScript language from source', ->
|
task 'build', 'build the CoffeeScript language from source', ->
|
||||||
fs.readdir('src').addCallback (files) ->
|
fs.readdir 'src', (err, files) ->
|
||||||
files: 'src/' + file for file in files when file.match(/\.coffee$/)
|
files: 'src/' + file for file in files when file.match(/\.coffee$/)
|
||||||
run ['-o', 'lib'].concat(files)
|
run ['-o', 'lib'].concat(files)
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ task 'test', 'run the CoffeeScript language test suite', ->
|
||||||
process.addListener 'exit', ->
|
process.addListener 'exit', ->
|
||||||
time: ((new Date() - start_time) / 1000).toFixed(2)
|
time: ((new Date() - start_time) / 1000).toFixed(2)
|
||||||
puts '\033[0;32mpassed ' + test_count + ' tests in ' + time + ' seconds\033[0m'
|
puts '\033[0;32mpassed ' + test_count + ' tests in ' + time + ' seconds\033[0m'
|
||||||
fs.readdir('test').addCallback (files) ->
|
fs.readdir 'test', (err, files) ->
|
||||||
for file in files
|
for file in files
|
||||||
fs.readFile('test/' + file).addCallback (source) ->
|
fs.readFile 'test/' + file, (err, source) ->
|
||||||
js: coffee.compile source
|
js: coffee.compile source
|
||||||
process.compile js, file
|
process.compile js, file
|
|
@ -57,7 +57,7 @@
|
||||||
throw new Error('Cakefile not found in ' + process.cwd());
|
throw new Error('Cakefile not found in ' + process.cwd());
|
||||||
}
|
}
|
||||||
args = process.ARGV.slice(2, process.ARGV.length);
|
args = process.ARGV.slice(2, process.ARGV.length);
|
||||||
return fs.readFile('Cakefile').addCallback(function(source) {
|
return fs.readFile('Cakefile', function(err, source) {
|
||||||
var _a, _b, _c, arg;
|
var _a, _b, _c, arg;
|
||||||
eval(coffee.compile(source));
|
eval(coffee.compile(source));
|
||||||
if (!(args.length)) {
|
if (!(args.length)) {
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
if (!((source = sources.shift()))) {
|
if (!((source = sources.shift()))) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return fs.readFile(source).addCallback(function(code) {
|
return fs.readFile(source, function(err, code) {
|
||||||
compile_script(source, code);
|
compile_script(source, code);
|
||||||
return compile_scripts();
|
return compile_scripts();
|
||||||
});
|
});
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
if (curr.mtime.getTime() === prev.mtime.getTime()) {
|
if (curr.mtime.getTime() === prev.mtime.getTime()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return fs.readFile(source).addCallback(function(code) {
|
return fs.readFile(source, function(err, code) {
|
||||||
return compile_script(source, code);
|
return compile_script(source, code);
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -36,7 +36,7 @@ exports.run: ->
|
||||||
path.exists 'Cakefile', (exists) ->
|
path.exists 'Cakefile', (exists) ->
|
||||||
throw new Error('Cakefile not found in ' + process.cwd()) unless exists
|
throw new Error('Cakefile not found in ' + process.cwd()) unless exists
|
||||||
args: process.ARGV[2...process.ARGV.length]
|
args: process.ARGV[2...process.ARGV.length]
|
||||||
fs.readFile('Cakefile').addCallback (source) ->
|
fs.readFile 'Cakefile', (err, source) ->
|
||||||
eval coffee.compile source
|
eval coffee.compile source
|
||||||
return print_tasks() unless args.length
|
return print_tasks() unless args.length
|
||||||
for arg in args
|
for arg in args
|
||||||
|
|
|
@ -71,7 +71,7 @@ compile: (script, source) ->
|
||||||
# or JSLint results.
|
# or JSLint results.
|
||||||
compile_scripts: ->
|
compile_scripts: ->
|
||||||
return unless source: sources.shift()
|
return unless source: sources.shift()
|
||||||
fs.readFile(source).addCallback (code) ->
|
fs.readFile source, 'raw', (err, code) ->
|
||||||
compile_script(source, code)
|
compile_script(source, code)
|
||||||
compile_scripts()
|
compile_scripts()
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ watch_scripts: ->
|
||||||
for source in sources
|
for source in sources
|
||||||
process.watchFile source, {persistent: true, interval: 500}, (curr, prev) ->
|
process.watchFile source, {persistent: true, interval: 500}, (curr, prev) ->
|
||||||
return if curr.mtime.getTime() is prev.mtime.getTime()
|
return if curr.mtime.getTime() is prev.mtime.getTime()
|
||||||
fs.readFile(source).addCallback (code) -> compile_script(source, code)
|
fs.readFile source, (err, code) -> compile_script(source, code)
|
||||||
|
|
||||||
# Write out a JavaScript source file with the compiled code.
|
# Write out a JavaScript source file with the compiled code.
|
||||||
write_js: (source, js) ->
|
write_js: (source, js) ->
|
||||||
|
|
Loading…
Reference in a new issue