Permalink
Browse files

Merge branch 'master' into configuration-env

  • Loading branch information...
2 parents effc6fb + 3eb67db commit 280bdf58f81cf109cef4716039375ebe1a9eae08 @sstephenson sstephenson committed Nov 14, 2011
Showing with 35 additions and 8 deletions.
  1. +6 −0 .travis.yml
  2. +9 −0 Cakefile
  3. +5 −2 lib/daemon.js
  4. +7 −5 package.json
  5. +8 −1 src/daemon.coffee
View
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
+notifications:
+ disabled: true
View
@@ -50,6 +50,15 @@ task 'build', 'Compile CoffeeScript source files', ->
task 'watch', 'Recompile CoffeeScript source files when modified', ->
build true
+task 'pretest', "Install test dependencies", ->
+ exec 'which ruby gem', (err) ->
+ throw "ruby not found" if err
+
+ exec 'ruby -rubygems -e \'require "rack"\'', (err) ->
+ if err
+ exec 'gem install rack', (err, stdout, stderr) ->
+ throw err if err
+
task 'test', 'Run the Pow test suite', ->
build ->
process.env["RUBYOPT"] = "-rubygems"
View

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

Oops, something went wrong.
View
@@ -10,10 +10,11 @@
, "main": "./lib/index.js"
, "dependencies": {
"async": "0.1.8"
- , "coffee-script": ">= 1.1.0"
+ , "coffee-script": "1.1.3"
, "connect": ">= 1.0.3"
- , "log": ">= 1.1.1"
, "dnsserver": "0.1.0"
+ , "log": ">= 1.1.1"
+ , "nack": "~> 0.13"
, "request": "~> 2.2"
}
, "devDependencies": {
@@ -22,8 +23,9 @@
}
, "engines" : { "node" : ">=0.4.1" }
, "scripts": {
- "test": "cake test"
-, "start": "cake start"
-, "stop": "cake stop"
+ "pretest": "cake pretest"
+ , "test": "cake test"
+ , "start": "cake start"
+ , "stop": "cake stop"
}
}
View
@@ -32,7 +32,14 @@ module.exports = class Daemon extends EventEmitter
startServer = (server, port, callback) -> process.nextTick ->
try
- server.listen port, -> callback null
+ server.on 'error', callback
+
+ server.once 'listening', ->
+ server.removeListener 'error', callback
+ callback()
+
+ server.listen port
+
catch err
callback err

0 comments on commit 280bdf5

Please sign in to comment.