Skip to content
This repository has been archived by the owner on Jan 30, 2019. It is now read-only.

Commit

Permalink
Clean up task names
Browse files Browse the repository at this point in the history
  • Loading branch information
hurrymaplelad committed Oct 11, 2014
1 parent 066f98e commit 0a3f633
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
27 changes: 13 additions & 14 deletions gulpfile.coffee
@@ -1,7 +1,6 @@
gulp = require 'gulp'
gutil = require 'gulp-util'
settings = require './settings'
logProcess = require 'process-logger'

gulp.task 'clean', ->
del = require 'del'
Expand Down Expand Up @@ -43,6 +42,7 @@ gulp.task 'serve:dev', (done) ->
gulp.task 'serve:selenium', ->
selenium = require 'selenium-standalone'
tcpPort = require 'tcp-port-used'
logProcess = require 'process-logger'

servers.selenium = selenium
stdio: settings.verbose and 'pipe' or 'ignore'
Expand All @@ -53,7 +53,7 @@ gulp.task 'serve:selenium', ->

return tcpPort.waitUntilUsed(settings.seleniumServer.port, 500, 20000)

gulp.task 'spec:crawl', ['build', 'serve:dev'], (done) ->
gulp.task 'crawl', ['build', 'serve:dev'], (done) ->
Crawler = require 'simplecrawler'
referrers = {}
crawler = Crawler.crawl settings.devServerUrl()
Expand All @@ -67,8 +67,10 @@ gulp.task 'spec:crawl', ['build', 'serve:dev'], (done) ->
.on 'complete', done
crawler.timeout = 2000

gulp.task 'spec:mocha', ['build', 'serve:dev', 'serve:selenium'], (done) ->
gulp.task 'mocha', ['build', 'serve:dev', 'serve:selenium'], (done) ->
{spawn} = require 'child_process'
logProcess = require 'process-logger'

mocha = spawn 'mocha', [
'--compilers', 'coffee:coffee-script/register'
'--reporter', 'spec'
Expand All @@ -81,8 +83,8 @@ gulp.task 'spec:mocha', ['build', 'serve:dev', 'serve:selenium'], (done) ->
logProcess mocha, prefix: settings.verbose and '[mocha]' or ''
return null # don't return a stream

gulp.task 'spec', ['spec:crawl', 'spec:mocha'], (done) ->
servers.shutdown done
gulp.task 'spec', ['crawl', 'mocha'], (done) ->
servers.shutdown done

gulp.task 'watch', ->
watch = require 'este-watch'
Expand Down Expand Up @@ -132,15 +134,12 @@ gulp.task 'nochanges', (done) ->
git = require 'gift'

git('.').status (err, status) ->
switch
when err
done err
when not status.clean
for filename, status of status.files
gutil.log gutil.colors.red "#{status.type} #{filename}"
done new Error 'Cant publish uncommitted changes'
else
done()
unless status?.clean
for filename, status of status.files
gutil.log gutil.colors.red "#{status.type} #{filename}"
done new Error 'There are uncommitted changes'
else
done()

# Commits built site to gh-pages branch
release = ({push}={}) ->
Expand Down
9 changes: 4 additions & 5 deletions settings.coffee
@@ -1,6 +1,6 @@
convict = require 'convict'

settings = convict
conf = convict
port:
doc: "Localhost port dev server should listen on"
format: 'port'
Expand Down Expand Up @@ -31,9 +31,8 @@ settings = convict
default: false

.validate()
.get()

settings.devServerUrl = ->
"http://localhost:#{@port}"
module.exports = conf.get()

module.exports = settings
module.exports.devServerUrl = ->
"http://localhost:#{@port}"

0 comments on commit 0a3f633

Please sign in to comment.