Skip to content

Commit

Permalink
v6.21.6. Improvement.
Browse files Browse the repository at this point in the history
- v6.21.6 January 25, 2013
	- Better debugging around server starting
  • Loading branch information
balupton committed Jan 25, 2013
1 parent 8dcd8f3 commit 3ef5235
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions History.md
@@ -1,5 +1,8 @@
## History

- v6.21.6 January 25, 2013
- Better debugging around server starting

- v6.21.5 January 24, 2013
- Supports Node v0.9
- Added `renderSingleExtensions` option
Expand Down
1 change: 1 addition & 0 deletions locale/en.cson
Expand Up @@ -42,6 +42,7 @@

# Server
serverInUse: "Could not start the web server, chances are the desired port %s is already in use"
serverStart: "Starting server on port %s and directory %s"
serverStarted: "DocPad listening to %s on directory %s"

# Watching
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "docpad",
"version": "6.21.5",
"version": "6.21.6",
"description": "DocPad is a language agnostic document management system. This means you write your website as documents, in whatever language you wish, and DocPad will handle the compiling, templates and layouts for you. For static documents it will generate static files, for dynamic documents it'll re-render them on each request. You can utilise DocPad by itself, or use it as a module your own custom system. It's pretty cool, and well worth checking out. We love it.",
"homepage": "https://github.com/bevry/docpad",
"installUrl": "http://docpad.org/install",
Expand Down
5 changes: 2 additions & 3 deletions src/lib/docpad.coffee
Expand Up @@ -3289,7 +3289,6 @@ class DocPad extends EventEmitterEnhanced
return next(err) if err

# Done
docpad.log 'debug', 'Server setup'
return next()

# Start Server
Expand All @@ -3304,14 +3303,14 @@ class DocPad extends EventEmitterEnhanced
return next(err)

# Listen
docpad.log 'debug', util.format(locale.serverStart, port, config.outPath)
serverHttp.listen port, ->
# Log
address = serverHttp.address()
serverHostname = if address.address is '0.0.0.0' then 'localhost' else address.address
serverPort = address.port
serverLocation = "http://#{serverHostname}:#{serverPort}/"
serverDir = config.outPath
docpad.log 'info', util.format(locale.serverStarted, serverLocation, serverDir)
docpad.log 'info', util.format(locale.serverStarted, serverLocation, config.outPath)

# Done
return next()
Expand Down
8 changes: 4 additions & 4 deletions src/test/actions.test.coffee
Expand Up @@ -132,29 +132,29 @@ joe.suite 'docpad-actions', (suite,test) ->
return done(err) if err
balUtil.readFile "#{outExpectedPath}/html.html", (err,expected) ->
return done(err) if err
expect(actual.toString()).to.be.equal(expected.toString())
expect(actual.toString().trim()).to.be.equal(expected.toString().trim())
done()

test 'served custom urls', (done) ->
request "#{baseUrl}/my-custom-url", (err,response,actual) ->
return done(err) if err
balUtil.readFile "#{outExpectedPath}/custom-url.html", (err,expected) ->
return done(err) if err
expect(actual.toString()).to.be.equal(expected.toString())
expect(actual.toString().trim()).to.be.equal(expected.toString().trim())
done()

test 'served dynamic documents - part 1/2', (done) ->
request "#{baseUrl}/dynamic.html?name=ben", (err,response,actual) ->
return done(err) if err
expected = 'hi ben'
expect(actual.toString()).to.be.equal(expected)
expect(actual.toString().trim()).to.be.equal(expected)
done()

test 'served dynamic documents - part 2/2', (done) ->
request "#{baseUrl}/dynamic.html?name=joe", (err,response,actual) ->
return done(err) if err
expected = 'hi joe'
expect(actual.toString()).to.be.equal(expected)
expect(actual.toString().trim()).to.be.equal(expected)
done()

test 'completed', (done) ->
Expand Down

0 comments on commit 3ef5235

Please sign in to comment.