Permalink
Browse files

fudging bin

  • Loading branch information...
1 parent f7a166e commit ad6ed83512987534f836286c99fb577071dd15a0 @jashkenas jashkenas committed Sep 3, 2010
Showing with 9 additions and 10 deletions.
  1. +4 −0 Cakefile
  2. +4 −9 bin/pixel-ping
  3. +1 −1 test/test-ping.coffee
View
@@ -5,3 +5,7 @@ fs = require 'fs'
task 'build', 'Build and watch the CoffeeScript source files', ->
coffee = spawn 'coffee', ['-cw', '-o', 'lib', 'src']
coffee.stdout.on 'data', (data) -> print data.toString()
+
+task 'test', 'Test Pixel Ping', ->
+ coffee = spawn 'coffee', ['test/test-ping.coffee']
+ coffee.stdout.on 'data', (data) -> print data.toString()
View
@@ -1,12 +1,7 @@
#!/usr/bin/env node
-var path = require('path'),
- fs = require('fs'),
- lib = path.join(__dirname, "..", "lib/"),
- cmd = "node " + lib + "pixel-ping.js " + (process.argv[2] || "")
-;
+var path = require('path');
+var fs = require('fs');
+var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
-require("child_process").exec(cmd, function(e, out, err){
- if(e) console.error(err.read());
-});
-
+require(lib + '/pixel-ping');
@@ -19,7 +19,7 @@ server = http.createServer (req, res) ->
server.listen 6999, 'localhost'
-ping = spawn 'node', ['lib/pixel-ping.js', 'test/config.json']
+ping = spawn 'node', ['bin/pixel-ping', 'test/config.json']
delay = (time, func) -> setTimeout func, time

0 comments on commit ad6ed83

Please sign in to comment.