Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      _.extend(@options, options)

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>
```

Response:
var log, spawn;

log = require('./logger');

spawn = require('child_process').spawn;

module.exports = function() {
  this.Processes = {};
  return this.Process = class Process {
    constructor(file, message, options = {}) {
      this.stop = this.stop.bind(this);
      this._stdout = this._stdout.bind(this);
      this._stderr = this._stderr.bind(this);
      this._exit = this._exit.bind(this);
      this._error = this._error.bind(this);
      this._close = this._close.bind(this);
      this.file = file;
      this.message = message;
      _.extend(this.options, options);
    }

    start(...args) {
      if (!this._started) {
        this._started = $.defer();
        this._process = spawn('node', [this.file].concat(args));
        this._process.stdout.on('data', this._stdout);
        this._process.stderr.on('data', this._stderr);
        this._process.on('exit', this._exit);
        this._process.on('error', this._error);
        this._process.on('close', this._close);
        this._process.on('disconnect', this._disconnect);
        this._process.on('message', this._message);
        process.on('exit', this.stop);
        process.on('error', this.stop);
      }
      return this._started.promise;
    }

    stop() {
      if (this._process) {
        this._process.kill() && (this._process = null);
      }
      return $.fulfilled(!this._process);
    }

    _stdout(data) {
      this._logBuffer(log.info, "STDOUT", data);
      if (this._started.promise.isPending()) {
        if (~data.toString().indexOf(this.message)) {
          return this._started.fulfill();
        }
      }
    }

    _stderr(data) {
      return this._logBuffer(log.warn, "STDERR", data);
    }

    _exit(code, signal) {
      return this._log(log.error, "EXIT", [code, signal].join(', '));
    }

    _error(error) {
      return this._started.reject(error);
    }

    _close(code, signal) {}

  };
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var log, spawn;

log = require('./logger');

spawn = require('child_process').spawn;

module.exports = function() {
  this.Processes = {};
  return this.Process = class Process {
    constructor(file, message, options = {}) {
      this.stop = this.stop.bind(this);
      this._stdout = this._stdout.bind(this);
      this._stderr = this._stderr.bind(this);
      this._exit = this._exit.bind(this);
      this._error = this._error.bind(this);
      this._close = this._close.bind(this);
      this.file = file;
      this.message = message;
      _.extend(this.options, options);
    }

    start(...args) {
      if (!this._started) {
        this._started = $.defer();
        this._process = spawn('node', [this.file].concat(args));
        this._process.stdout.on('data', this._stdout);
        this._process.stderr.on('data', this._stderr);
        this._process.on('exit', this._exit);
        this._process.on('error', this._error);
        this._process.on('close', this._close);
        this._process.on('disconnect', this._disconnect);
        this._process.on('message', this._message);
        process.on('exit', this.stop);
        process.on('error', this.stop);
      }
      return this._started.promise;
    }

    stop() {
      if (this._process) {
        this._process.kill() && (this._process = null);
      }
      return $.fulfilled(!this._process);
    }

    _stdout(data) {
      this._logBuffer(log.info, "STDOUT", data);
      if (this._started.promise.isPending()) {
        if (~data.toString().indexOf(this.message)) {
          return this._started.fulfill();
        }
      }
    }

    _stderr(data) {
      return this._logBuffer(log.warn, "STDERR", data);
    }

    _exit(code, signal) {
      return this._log(log.error, "EXIT", [code, signal].join(', '));
    }

    _error(error) {
      return this._started.reject(error);
    }

    _close(code, signal) {}

  };
};
```

Response:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      _.extend(@options, options)

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Prompt:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      _.extend(@options, options)

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

Response:
process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Response:
Swag.addHelper 'log', (value) ->
    console.log value
, 'string|number|boolean|array|object'

Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Swag.addHelper 'log', (value) ->
    console.log value
, 'string|number|boolean|array|object'

Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'
```

Response:
Swag.addHelper('log', function(value) {
  return console.log(value);
}, 'string|number|boolean|array|object');

Swag.addHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Swag.addHelper('log', function(value) {
  return console.log(value);
}, 'string|number|boolean|array|object');

Swag.addHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});
```

Response:
Swag.addHelper 'log', (value) ->
    console.log value
, 'string|number|boolean|array|object'

Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Swag.addHelper 'log', (value) ->
    console.log value
, 'string|number|boolean|array|object'

Response:
Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Response:
Swag.addHelper 'log', (value) ->
    value = Utils.result value
    console.log value
, 'string|number|boolean|array|object'

Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Swag.addHelper 'log', (value) ->
    value = Utils.result value
    console.log value
, 'string|number|boolean|array|object'

Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'
```

Response:
Swag.addHelper('log', function(value) {
  value = Utils.result(value);
  return console.log(value);
}, 'string|number|boolean|array|object');

Swag.addHelper('debug', function(value) {
  if (!Utils.isUndefined(value)) {
    value = Utils.result(value);
  }
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Swag.addHelper('log', function(value) {
  value = Utils.result(value);
  return console.log(value);
}, 'string|number|boolean|array|object');

Swag.addHelper('debug', function(value) {
  if (!Utils.isUndefined(value)) {
    value = Utils.result(value);
  }
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});
```

Response:
Swag.addHelper 'log', (value) ->
    value = Utils.result value
    console.log value
, 'string|number|boolean|array|object'

Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Swag.addHelper 'log', (value) ->
    value = Utils.result value
    console.log value
, 'string|number|boolean|array|object'

Response:
Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Response:
Swag.addHelper 'log', (value) ->
    unless Utils.isUndefined value
        value = Utils.result value
        console.log value
    else
        Utils.err '{{log}} takes one arguments (string|number|boolean|array|object).'

Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Swag.addHelper 'log', (value) ->
    unless Utils.isUndefined value
        value = Utils.result value
        console.log value
    else
        Utils.err '{{log}} takes one arguments (string|number|boolean|array|object).'

Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'
```

Response:
Swag.addHelper('log', function(value) {
  if (!Utils.isUndefined(value)) {
    value = Utils.result(value);
    return console.log(value);
  } else {
    return Utils.err('{{log}} takes one arguments (string|number|boolean|array|object).');
  }
});

Swag.addHelper('debug', function(value) {
  if (!Utils.isUndefined(value)) {
    value = Utils.result(value);
  }
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Swag.addHelper('log', function(value) {
  if (!Utils.isUndefined(value)) {
    value = Utils.result(value);
    return console.log(value);
  } else {
    return Utils.err('{{log}} takes one arguments (string|number|boolean|array|object).');
  }
});

Swag.addHelper('debug', function(value) {
  if (!Utils.isUndefined(value)) {
    value = Utils.result(value);
  }
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});
```

Response:
Swag.addHelper 'log', (value) ->
    unless Utils.isUndefined value
        value = Utils.result value
        console.log value
    else
        Utils.err '{{log}} takes one arguments (string|number|boolean|array|object).'

Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Swag.addHelper 'log', (value) ->
    unless Utils.isUndefined value
        value = Utils.result value
        console.log value
    else
        Utils.err '{{log}} takes one arguments (string|number|boolean|array|object).'

Response:
Swag.addHelper 'debug', (value) ->
    value = Utils.result value unless Utils.isUndefined value
    console.log 'Context: ', this
    console.log 'Value: ', value unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Response:
Swag.addHelper 'log', (value) ->
    console.log value

Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Swag.addHelper 'log', (value) ->
    console.log value

Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'
```

Response:
Swag.addHelper('log', function(value) {
  return console.log(value);
});

Swag.addHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Swag.addHelper('log', function(value) {
  return console.log(value);
});

Swag.addHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});
```

Response:
Swag.addHelper 'log', (value) ->
    console.log value

Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Swag.addHelper 'log', (value) ->
    console.log value

Response:
Swag.addHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Response:
Swag.registerHelper 'log', (value) ->
    console.log value

Swag.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Swag.registerHelper 'log', (value) ->
    console.log value

Swag.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'
```

Response:
Swag.registerHelper('log', function(value) {
  return console.log(value);
});

Swag.registerHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Swag.registerHelper('log', function(value) {
  return console.log(value);
});

Swag.registerHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});
```

Response:
Swag.registerHelper 'log', (value) ->
    console.log value

Swag.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Swag.registerHelper 'log', (value) ->
    console.log value

Response:
Swag.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Response:
Handlebars.registerHelper 'log', (value) ->
    console.log value

Handlebars.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Handlebars.registerHelper 'log', (value) ->
    console.log value

Handlebars.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'
```

Response:
Handlebars.registerHelper('log', function(value) {
  return console.log(value);
});

Handlebars.registerHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Handlebars.registerHelper('log', function(value) {
  return console.log(value);
});

Handlebars.registerHelper('debug', function(value) {
  console.log('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.log('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});
```

Response:
Handlebars.registerHelper 'log', (value) ->
    console.log value

Handlebars.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Handlebars.registerHelper 'log', (value) ->
    console.log value

Response:
Handlebars.registerHelper 'debug', (value) ->
    console.log 'Context: ', @
    console.log('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Response:
Handlebars.registerHelper 'log', (value) ->
    console.log value

Handlebars.registerHelper 'debug', (value) ->
    console.debug 'Context: ', @
    console.debug('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Handlebars.registerHelper 'log', (value) ->
    console.log value

Handlebars.registerHelper 'debug', (value) ->
    console.debug 'Context: ', @
    console.debug('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'
```

Response:
Handlebars.registerHelper('log', function(value) {
  return console.log(value);
});

Handlebars.registerHelper('debug', function(value) {
  console.debug('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.debug('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Handlebars.registerHelper('log', function(value) {
  return console.log(value);
});

Handlebars.registerHelper('debug', function(value) {
  console.debug('Context: ', this);
  if (!Utils.isUndefined(value)) {
    console.debug('Value: ', value);
  }
  return console.log('-----------------------------------------------');
});
```

Response:
Handlebars.registerHelper 'log', (value) ->
    console.log value

Handlebars.registerHelper 'debug', (value) ->
    console.debug 'Context: ', @
    console.debug('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Prompt:
Handlebars.registerHelper 'log', (value) ->
    console.log value

Response:
Handlebars.registerHelper 'debug', (value) ->
    console.debug 'Context: ', @
    console.debug('Value: ', value) unless Utils.isUndefined value
    console.log '-----------------------------------------------'


Response:
prepare = (done) ->
  async.auto
    prepare: app.prepare
    createGuestUser: app.createGuestUser
  , done

describe 'Guest.Room#ReadOne', ->

  before prepare

  it 'should get the room info and nested team infomation', (done) ->
    options =
      method: 'get'
      url: 'guest/rooms/' + app.room1.guestToken
    request options, (err, res, room) ->
      room.should.have.properties 'team', 'topic'
      room.should.not.have.properties 'members', 'latestMessages'
      room.team.should.have.properties 'name'
      done err

  after clear

describe 'Guest.Room#Join', ->

  before prepare

  it 'should join a room and get detail infomation of this room', (done) ->

    async.auto
      broadcast: (callback) ->
        app.broadcast = (room, event, data) ->
          hits = 0
          if event is 'room:join'
            hits |= 0b1
            data.should.have.properties 'name', 'avatarUrl', '_roomId'
            data._roomId.should.eql app.room1._id
          callback() if hits is 0b1
      join: (callback) ->  # Join user2 to the room
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, (err, res, room) ->
          room.should.have.properties '_teamId', 'topic', 'members', 'latestMessages', 'unread'
          (room.members.some (member) -> member._id is app.user1._id).should.eql true
          room.members.forEach (member) -> member.should.not.have.properties 'email', 'mobile'
          callback err
    , done


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
prepare = (done) ->
  async.auto
    prepare: app.prepare
    createGuestUser: app.createGuestUser
  , done

describe 'Guest.Room#ReadOne', ->

  before prepare

  it 'should get the room info and nested team infomation', (done) ->
    options =
      method: 'get'
      url: 'guest/rooms/' + app.room1.guestToken
    request options, (err, res, room) ->
      room.should.have.properties 'team', 'topic'
      room.should.not.have.properties 'members', 'latestMessages'
      room.team.should.have.properties 'name'
      done err

  after clear

describe 'Guest.Room#Join', ->

  before prepare

  it 'should join a room and get detail infomation of this room', (done) ->

    async.auto
      broadcast: (callback) ->
        app.broadcast = (room, event, data) ->
          hits = 0
          if event is 'room:join'
            hits |= 0b1
            data.should.have.properties 'name', 'avatarUrl', '_roomId'
            data._roomId.should.eql app.room1._id
          callback() if hits is 0b1
      join: (callback) ->  # Join user2 to the room
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, (err, res, room) ->
          room.should.have.properties '_teamId', 'topic', 'members', 'latestMessages', 'unread'
          (room.members.some (member) -> member._id is app.user1._id).should.eql true
          room.members.forEach (member) -> member.should.not.have.properties 'email', 'mobile'
          callback err
    , done
```

Response:
var prepare;

prepare = function(done) {
  return async.auto({
    prepare: app.prepare,
    createGuestUser: app.createGuestUser
  }, done);
};

describe('Guest.Room#ReadOne', function() {
  before(prepare);
  it('should get the room info and nested team infomation', function(done) {
    var options;
    options = {
      method: 'get',
      url: 'guest/rooms/' + app.room1.guestToken
    };
    return request(options, function(err, res, room) {
      room.should.have.properties('team', 'topic');
      room.should.not.have.properties('members', 'latestMessages');
      room.team.should.have.properties('name');
      return done(err);
    });
  });
  return after(clear);
});

describe('Guest.Room#Join', function() {
  before(prepare);
  return it('should join a room and get detail infomation of this room', function(done) {
    return async.auto({
      broadcast: function(callback) {
        return app.broadcast = function(room, event, data) {
          var hits;
          hits = 0;
          if (event === 'room:join') {
            hits |= 0b1;
            data.should.have.properties('name', 'avatarUrl', '_roomId');
            data._roomId.should.eql(app.room1._id);
          }
          if (hits === 0b1) {
            return callback();
          }
        };
      },
      join: function(callback) { // Join user2 to the room
        var options;
        options = {
          method: 'post',
          url: `guest/rooms/${app.room1.guestToken}/join`,
          body: JSON.stringify({
            _sessionUserId: app.guest1._id
          })
        };
        return request(options, function(err, res, room) {
          room.should.have.properties('_teamId', 'topic', 'members', 'latestMessages', 'unread');
          (room.members.some(function(member) {
            return member._id === app.user1._id;
          })).should.eql(true);
          room.members.forEach(function(member) {
            return member.should.not.have.properties('email', 'mobile');
          });
          return callback(err);
        });
      }
    }, done);
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var prepare;

prepare = function(done) {
  return async.auto({
    prepare: app.prepare,
    createGuestUser: app.createGuestUser
  }, done);
};

describe('Guest.Room#ReadOne', function() {
  before(prepare);
  it('should get the room info and nested team infomation', function(done) {
    var options;
    options = {
      method: 'get',
      url: 'guest/rooms/' + app.room1.guestToken
    };
    return request(options, function(err, res, room) {
      room.should.have.properties('team', 'topic');
      room.should.not.have.properties('members', 'latestMessages');
      room.team.should.have.properties('name');
      return done(err);
    });
  });
  return after(clear);
});

describe('Guest.Room#Join', function() {
  before(prepare);
  return it('should join a room and get detail infomation of this room', function(done) {
    return async.auto({
      broadcast: function(callback) {
        return app.broadcast = function(room, event, data) {
          var hits;
          hits = 0;
          if (event === 'room:join') {
            hits |= 0b1;
            data.should.have.properties('name', 'avatarUrl', '_roomId');
            data._roomId.should.eql(app.room1._id);
          }
          if (hits === 0b1) {
            return callback();
          }
        };
      },
      join: function(callback) { // Join user2 to the room
        var options;
        options = {
          method: 'post',
          url: `guest/rooms/${app.room1.guestToken}/join`,
          body: JSON.stringify({
            _sessionUserId: app.guest1._id
          })
        };
        return request(options, function(err, res, room) {
          room.should.have.properties('_teamId', 'topic', 'members', 'latestMessages', 'unread');
          (room.members.some(function(member) {
            return member._id === app.user1._id;
          })).should.eql(true);
          room.members.forEach(function(member) {
            return member.should.not.have.properties('email', 'mobile');
          });
          return callback(err);
        });
      }
    }, done);
  });
});
```

Response:
prepare = (done) ->
  async.auto
    prepare: app.prepare
    createGuestUser: app.createGuestUser
  , done

describe 'Guest.Room#ReadOne', ->

  before prepare

  it 'should get the room info and nested team infomation', (done) ->
    options =
      method: 'get'
      url: 'guest/rooms/' + app.room1.guestToken
    request options, (err, res, room) ->
      room.should.have.properties 'team', 'topic'
      room.should.not.have.properties 'members', 'latestMessages'
      room.team.should.have.properties 'name'
      done err

  after clear

describe 'Guest.Room#Join', ->

  before prepare

  it 'should join a room and get detail infomation of this room', (done) ->

    async.auto
      broadcast: (callback) ->
        app.broadcast = (room, event, data) ->
          hits = 0
          if event is 'room:join'
            hits |= 0b1
            data.should.have.properties 'name', 'avatarUrl', '_roomId'
            data._roomId.should.eql app.room1._id
          callback() if hits is 0b1
      join: (callback) ->  # Join user2 to the room
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, (err, res, room) ->
          room.should.have.properties '_teamId', 'topic', 'members', 'latestMessages', 'unread'
          (room.members.some (member) -> member._id is app.user1._id).should.eql true
          room.members.forEach (member) -> member.should.not.have.properties 'email', 'mobile'
          callback err
    , done


Prompt:
prepare = (done) ->
  async.auto
    prepare: app.prepare
    createGuestUser: app.createGuestUser
  , done

describe 'Guest.Room#ReadOne', ->

  before prepare

  it 'should get the room info and nested team infomation', (done) ->
    options =
      method: 'get'
      url: 'guest/rooms/' + app.room1.guestToken
    request options, (err, res, room) ->
      room.should.have.properties 'team', 'topic'
      room.should.not.have.properties 'members', 'latestMessages'
      room.team.should.have.properties 'name'
      done err

  after clear

describe 'Guest.Room#Join', ->

Response:
before prepare

  it 'should join a room and get detail infomation of this room', (done) ->

    async.auto
      broadcast: (callback) ->
        app.broadcast = (room, event, data) ->
          hits = 0
          if event is 'room:join'
            hits |= 0b1
            data.should.have.properties 'name', 'avatarUrl', '_roomId'
            data._roomId.should.eql app.room1._id
          callback() if hits is 0b1
      join: (callback) ->  # Join user2 to the room
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, (err, res, room) ->
          room.should.have.properties '_teamId', 'topic', 'members', 'latestMessages', 'unread'
          (room.members.some (member) -> member._id is app.user1._id).should.eql true
          room.members.forEach (member) -> member.should.not.have.properties 'email', 'mobile'
          callback err
    , done


Response:
after clear

describe 'Guest.Room#Leave', ->

  before prepare

  it 'should leave the room and recieve the history message email', (done) ->
    async.auto
      join: (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        setTimeout ->
          request options, callback
        , 1000
      # Create messages by user1
      createMessages: ['join', (callback) ->
        options =
          method: 'post'
          url: 'messages'
          body: JSON.stringify
            _sessionUserId: app.user1._id
            _roomId: app.room1._id
            body: 'Hello Guest'
        request options, callback
      ]
      leave: ['createMessages', (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1._id}/leave"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, callback
      ]
      mailer: (callback) ->
        app.mailer = (email) ->
          {messages, to} = email
          to.should.eql app.guest1.email
          messages.length.should.eql 1
          callback()
    , done

  after clear


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
after clear

describe 'Guest.Room#Leave', ->

  before prepare

  it 'should leave the room and recieve the history message email', (done) ->
    async.auto
      join: (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        setTimeout ->
          request options, callback
        , 1000
      # Create messages by user1
      createMessages: ['join', (callback) ->
        options =
          method: 'post'
          url: 'messages'
          body: JSON.stringify
            _sessionUserId: app.user1._id
            _roomId: app.room1._id
            body: 'Hello Guest'
        request options, callback
      ]
      leave: ['createMessages', (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1._id}/leave"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, callback
      ]
      mailer: (callback) ->
        app.mailer = (email) ->
          {messages, to} = email
          to.should.eql app.guest1.email
          messages.length.should.eql 1
          callback()
    , done

  after clear
```

Response:
after(clear);

describe('Guest.Room#Leave', function() {
  before(prepare);
  it('should leave the room and recieve the history message email', function(done) {
    return async.auto({
      join: function(callback) {
        var options;
        options = {
          method: 'post',
          url: `guest/rooms/${app.room1.guestToken}/join`,
          body: JSON.stringify({
            _sessionUserId: app.guest1._id
          })
        };
        return setTimeout(function() {
          return request(options, callback);
        }, 1000);
      },
      // Create messages by user1
      createMessages: [
        'join',
        function(callback) {
          var options;
          options = {
            method: 'post',
            url: 'messages',
            body: JSON.stringify({
              _sessionUserId: app.user1._id,
              _roomId: app.room1._id,
              body: 'Hello Guest'
            })
          };
          return request(options,
        callback);
        }
      ],
      leave: [
        'createMessages',
        function(callback) {
          var options;
          options = {
            method: 'post',
            url: `guest/rooms/${app.room1._id}/leave`,
            body: JSON.stringify({
              _sessionUserId: app.guest1._id
            })
          };
          return request(options,
        callback);
        }
      ],
      mailer: function(callback) {
        return app.mailer = function(email) {
          var messages, to;
          ({messages, to} = email);
          to.should.eql(app.guest1.email);
          messages.length.should.eql(1);
          return callback();
        };
      }
    }, done);
  });
  return after(clear);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
after(clear);

describe('Guest.Room#Leave', function() {
  before(prepare);
  it('should leave the room and recieve the history message email', function(done) {
    return async.auto({
      join: function(callback) {
        var options;
        options = {
          method: 'post',
          url: `guest/rooms/${app.room1.guestToken}/join`,
          body: JSON.stringify({
            _sessionUserId: app.guest1._id
          })
        };
        return setTimeout(function() {
          return request(options, callback);
        }, 1000);
      },
      // Create messages by user1
      createMessages: [
        'join',
        function(callback) {
          var options;
          options = {
            method: 'post',
            url: 'messages',
            body: JSON.stringify({
              _sessionUserId: app.user1._id,
              _roomId: app.room1._id,
              body: 'Hello Guest'
            })
          };
          return request(options,
        callback);
        }
      ],
      leave: [
        'createMessages',
        function(callback) {
          var options;
          options = {
            method: 'post',
            url: `guest/rooms/${app.room1._id}/leave`,
            body: JSON.stringify({
              _sessionUserId: app.guest1._id
            })
          };
          return request(options,
        callback);
        }
      ],
      mailer: function(callback) {
        return app.mailer = function(email) {
          var messages, to;
          ({messages, to} = email);
          to.should.eql(app.guest1.email);
          messages.length.should.eql(1);
          return callback();
        };
      }
    }, done);
  });
  return after(clear);
});
```

Response:
after clear

describe 'Guest.Room#Leave', ->

  before prepare

  it 'should leave the room and recieve the history message email', (done) ->
    async.auto
      join: (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        setTimeout ->
          request options, callback
        , 1000
      # Create messages by user1
      createMessages: ['join', (callback) ->
        options =
          method: 'post'
          url: 'messages'
          body: JSON.stringify
            _sessionUserId: app.user1._id
            _roomId: app.room1._id
            body: 'Hello Guest'
        request options, callback
      ]
      leave: ['createMessages', (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1._id}/leave"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, callback
      ]
      mailer: (callback) ->
        app.mailer = (email) ->
          {messages, to} = email
          to.should.eql app.guest1.email
          messages.length.should.eql 1
          callback()
    , done

  after clear


Prompt:
after clear

describe 'Guest.Room#Leave', ->

  before prepare

  it 'should leave the room and recieve the history message email', (done) ->
    async.auto
      join: (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1.guestToken}/join"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        setTimeout ->
          request options, callback
        , 1000
      # Create messages by user1
      createMessages: ['join', (callback) ->
        options =
          method: 'post'
          url: 'messages'

Response:
body: JSON.stringify
            _sessionUserId: app.user1._id
            _roomId: app.room1._id
            body: 'Hello Guest'
        request options, callback
      ]
      leave: ['createMessages', (callback) ->
        options =
          method: 'post'
          url: "guest/rooms/#{app.room1._id}/leave"
          body: JSON.stringify
            _sessionUserId: app.guest1._id
        request options, callback
      ]
      mailer: (callback) ->
        app.mailer = (email) ->
          {messages, to} = email
          to.should.eql app.guest1.email
          messages.length.should.eql 1
          callback()
    , done

  after clear


Response:
React = require 'react'
hljs = require 'highlight.js/lib/highlight'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'

reqwest = require '../util/reqwest'

lang = require '../locales/lang'

LoadingIndicator = React.createFactory require('react-lite-misc').LoadingIndicator

div    = React.createFactory 'div'
pre = React.createFactory 'pre'
code = React.createFactory 'code'

T = React.PropTypes

module.exports = React.createClass
  displayName: 'file-text'
  mixins: [PureRenderMixin]

  propTypes:
    file: T.instanceOf(Immutable.Map)

  getInitialState: ->
    loading: true
    text: null

  componentDidMount: ->
    @loadTextContent()

  loadTextContent: ->
    # file server rejects X-Socket-Id, so bypass api.get
    # and X-Requested-With is added by reqwest by default
    reqwest
      url: @props.file.get('downloadUrl')
      method: 'get'
      type: 'text'
      success: (resp) =>
        # text, html, css and JSON supported
        @setState text: resp.responseText, loading: false
      error: (resp) =>
        failedText = "#{lang.getText('text-download-failed')}: #{@props.file.get('fileName')}"
        @setState text: failedText, loading: false

  renderCode: ->
    result = hljs.highlightAuto (@state.text or '')
    pre {},
      code
        className: result.language


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
hljs = require 'highlight.js/lib/highlight'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'

reqwest = require '../util/reqwest'

lang = require '../locales/lang'

LoadingIndicator = React.createFactory require('react-lite-misc').LoadingIndicator

div    = React.createFactory 'div'
pre = React.createFactory 'pre'
code = React.createFactory 'code'

T = React.PropTypes

module.exports = React.createClass
  displayName: 'file-text'
  mixins: [PureRenderMixin]

  propTypes:
    file: T.instanceOf(Immutable.Map)

  getInitialState: ->
    loading: true
    text: null

  componentDidMount: ->
    @loadTextContent()

  loadTextContent: ->
    # file server rejects X-Socket-Id, so bypass api.get
    # and X-Requested-With is added by reqwest by default
    reqwest
      url: @props.file.get('downloadUrl')
      method: 'get'
      type: 'text'
      success: (resp) =>
        # text, html, css and JSON supported
        @setState text: resp.responseText, loading: false
      error: (resp) =>
        failedText = "#{lang.getText('text-download-failed')}: #{@props.file.get('fileName')}"
        @setState text: failedText, loading: false

  renderCode: ->
    result = hljs.highlightAuto (@state.text or '')
    pre {},
      code
        className: result.language
```

Response:
var Immutable, LoadingIndicator, PureRenderMixin, React, T, code, div, hljs, lang, pre, reqwest;

React = require('react');

hljs = require('highlight.js/lib/highlight');

Immutable = require('immutable');

PureRenderMixin = require('react-addons-pure-render-mixin');

reqwest = require('../util/reqwest');

lang = require('../locales/lang');

LoadingIndicator = React.createFactory(require('react-lite-misc').LoadingIndicator);

div = React.createFactory('div');

pre = React.createFactory('pre');

code = React.createFactory('code');

T = React.PropTypes;

module.exports = React.createClass({
  displayName: 'file-text',
  mixins: [PureRenderMixin],
  propTypes: {
    file: T.instanceOf(Immutable.Map)
  },
  getInitialState: function() {
    return {
      loading: true,
      text: null
    };
  },
  componentDidMount: function() {
    return this.loadTextContent();
  },
  loadTextContent: function() {
    // file server rejects X-Socket-Id, so bypass api.get
    // and X-Requested-With is added by reqwest by default
    return reqwest({
      url: this.props.file.get('downloadUrl'),
      method: 'get',
      type: 'text',
      success: (resp) => {
        // text, html, css and JSON supported
        return this.setState({
          text: resp.responseText,
          loading: false
        });
      },
      error: (resp) => {
        var failedText;
        failedText = `${lang.getText('text-download-failed')}: ${this.props.file.get('fileName')}`;
        return this.setState({
          text: failedText,
          loading: false
        });
      }
    });
  },
  renderCode: function() {
    var result;
    result = hljs.highlightAuto(this.state.text || '');
    return pre({}, code({
      className: result.language
    }));
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, LoadingIndicator, PureRenderMixin, React, T, code, div, hljs, lang, pre, reqwest;

React = require('react');

hljs = require('highlight.js/lib/highlight');

Immutable = require('immutable');

PureRenderMixin = require('react-addons-pure-render-mixin');

reqwest = require('../util/reqwest');

lang = require('../locales/lang');

LoadingIndicator = React.createFactory(require('react-lite-misc').LoadingIndicator);

div = React.createFactory('div');

pre = React.createFactory('pre');

code = React.createFactory('code');

T = React.PropTypes;

module.exports = React.createClass({
  displayName: 'file-text',
  mixins: [PureRenderMixin],
  propTypes: {
    file: T.instanceOf(Immutable.Map)
  },
  getInitialState: function() {
    return {
      loading: true,
      text: null
    };
  },
  componentDidMount: function() {
    return this.loadTextContent();
  },
  loadTextContent: function() {
    // file server rejects X-Socket-Id, so bypass api.get
    // and X-Requested-With is added by reqwest by default
    return reqwest({
      url: this.props.file.get('downloadUrl'),
      method: 'get',
      type: 'text',
      success: (resp) => {
        // text, html, css and JSON supported
        return this.setState({
          text: resp.responseText,
          loading: false
        });
      },
      error: (resp) => {
        var failedText;
        failedText = `${lang.getText('text-download-failed')}: ${this.props.file.get('fileName')}`;
        return this.setState({
          text: failedText,
          loading: false
        });
      }
    });
  },
  renderCode: function() {
    var result;
    result = hljs.highlightAuto(this.state.text || '');
    return pre({}, code({
      className: result.language
    }));
  }
});
```

Response:
React = require 'react'
hljs = require 'highlight.js/lib/highlight'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'

reqwest = require '../util/reqwest'

lang = require '../locales/lang'

LoadingIndicator = React.createFactory require('react-lite-misc').LoadingIndicator

div    = React.createFactory 'div'
pre = React.createFactory 'pre'
code = React.createFactory 'code'

T = React.PropTypes

module.exports = React.createClass
  displayName: 'file-text'
  mixins: [PureRenderMixin]

  propTypes:
    file: T.instanceOf(Immutable.Map)

  getInitialState: ->
    loading: true
    text: null

  componentDidMount: ->
    @loadTextContent()

  loadTextContent: ->
    # file server rejects X-Socket-Id, so bypass api.get
    # and X-Requested-With is added by reqwest by default
    reqwest
      url: @props.file.get('downloadUrl')
      method: 'get'
      type: 'text'
      success: (resp) =>
        # text, html, css and JSON supported
        @setState text: resp.responseText, loading: false
      error: (resp) =>
        failedText = "#{lang.getText('text-download-failed')}: #{@props.file.get('fileName')}"
        @setState text: failedText, loading: false

  renderCode: ->
    result = hljs.highlightAuto (@state.text or '')
    pre {},
      code
        className: result.language


Prompt:
React = require 'react'
hljs = require 'highlight.js/lib/highlight'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'

reqwest = require '../util/reqwest'

lang = require '../locales/lang'

LoadingIndicator = React.createFactory require('react-lite-misc').LoadingIndicator

div    = React.createFactory 'div'
pre = React.createFactory 'pre'
code = React.createFactory 'code'

T = React.PropTypes

module.exports = React.createClass
  displayName: 'file-text'
  mixins: [PureRenderMixin]

  propTypes:
    file: T.instanceOf(Immutable.Map)

  getInitialState: ->

Response:
loading: true
    text: null

  componentDidMount: ->
    @loadTextContent()

  loadTextContent: ->
    # file server rejects X-Socket-Id, so bypass api.get
    # and X-Requested-With is added by reqwest by default
    reqwest
      url: @props.file.get('downloadUrl')
      method: 'get'
      type: 'text'
      success: (resp) =>
        # text, html, css and JSON supported
        @setState text: resp.responseText, loading: false
      error: (resp) =>
        failedText = "#{lang.getText('text-download-failed')}: #{@props.file.get('fileName')}"
        @setState text: failedText, loading: false

  renderCode: ->
    result = hljs.highlightAuto (@state.text or '')
    pre {},
      code
        className: result.language


Response:
dangerouslySetInnerHTML:
          __html: result.value

  render: ->

    div className: 'file-text',
      if @state.loading
        LoadingIndicator()
      else
        div className: 'text-container',
          @renderCode()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
dangerouslySetInnerHTML:
          __html: result.value

  render: ->

    div className: 'file-text',
      if @state.loading
        LoadingIndicator()
      else
        div className: 'text-container',
          @renderCode()
```

Response:
({
  dangerouslySetInnerHTML: {
    __html: result.value
  },
  render: function() {
    return div({
      className: 'file-text'
    }, this.state.loading ? LoadingIndicator() : div({
      className: 'text-container'
    }, this.renderCode()));
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  dangerouslySetInnerHTML: {
    __html: result.value
  },
  render: function() {
    return div({
      className: 'file-text'
    }, this.state.loading ? LoadingIndicator() : div({
      className: 'text-container'
    }, this.renderCode()));
  }
});
```

Response:
dangerouslySetInnerHTML:
          __html: result.value

  render: ->

    div className: 'file-text',
      if @state.loading
        LoadingIndicator()
      else
        div className: 'text-container',
          @renderCode()


Prompt:
dangerouslySetInnerHTML:
          __html: result.value

  render: ->

Response:
div className: 'file-text',
      if @state.loading
        LoadingIndicator()
      else
        div className: 'text-container',
          @renderCode()


Response:
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).
  # `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpperCase() is "XML" and version is "1.0"
      return true

    return false


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).
  # `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpperCase() is "XML" and version is "1.0"
      return true

    return false
```

Response:
// Implements the DOMImplementation interface
var XMLDOMImplementation;

module.exports = XMLDOMImplementation = class XMLDOMImplementation {
  // Tests if the DOM implementation implements a specific feature.

  // `feature` The package name of the feature to test. In Level 1, the
  //           legal values are "HTML" and "XML" (case-insensitive).
  // `version` This is the version number of the package name to test.
  //           In Level 1, this is the string "1.0". If the version is
  //           not specified, supporting any version of the feature will
  //           cause the method to return true.
  hasFeature(feature, version) {
    if (feature.toUpperCase() === "XML" && version === "1.0") {
      return true;
    }
    return false;
  }

};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
// Implements the DOMImplementation interface
var XMLDOMImplementation;

module.exports = XMLDOMImplementation = class XMLDOMImplementation {
  // Tests if the DOM implementation implements a specific feature.

  // `feature` The package name of the feature to test. In Level 1, the
  //           legal values are "HTML" and "XML" (case-insensitive).
  // `version` This is the version number of the package name to test.
  //           In Level 1, this is the string "1.0". If the version is
  //           not specified, supporting any version of the feature will
  //           cause the method to return true.
  hasFeature(feature, version) {
    if (feature.toUpperCase() === "XML" && version === "1.0") {
      return true;
    }
    return false;
  }

};
```

Response:
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).
  # `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpperCase() is "XML" and version is "1.0"
      return true

    return false


Prompt:
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).

Response:
# `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpperCase() is "XML" and version is "1.0"
      return true

    return false


Response:
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).
  # `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpper() is "XML" and version is "1.0"
      return true

    return false


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).
  # `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpper() is "XML" and version is "1.0"
      return true

    return false
```

Response:
// Implements the DOMImplementation interface
var XMLDOMImplementation;

module.exports = XMLDOMImplementation = class XMLDOMImplementation {
  // Tests if the DOM implementation implements a specific feature.

  // `feature` The package name of the feature to test. In Level 1, the
  //           legal values are "HTML" and "XML" (case-insensitive).
  // `version` This is the version number of the package name to test.
  //           In Level 1, this is the string "1.0". If the version is
  //           not specified, supporting any version of the feature will
  //           cause the method to return true.
  hasFeature(feature, version) {
    if (feature.toUpper() === "XML" && version === "1.0") {
      return true;
    }
    return false;
  }

};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
// Implements the DOMImplementation interface
var XMLDOMImplementation;

module.exports = XMLDOMImplementation = class XMLDOMImplementation {
  // Tests if the DOM implementation implements a specific feature.

  // `feature` The package name of the feature to test. In Level 1, the
  //           legal values are "HTML" and "XML" (case-insensitive).
  // `version` This is the version number of the package name to test.
  //           In Level 1, this is the string "1.0". If the version is
  //           not specified, supporting any version of the feature will
  //           cause the method to return true.
  hasFeature(feature, version) {
    if (feature.toUpper() === "XML" && version === "1.0") {
      return true;
    }
    return false;
  }

};
```

Response:
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).
  # `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpper() is "XML" and version is "1.0"
      return true

    return false


Prompt:
# Implements the DOMImplementation interface
module.exports = class XMLDOMImplementation

  # Tests if the DOM implementation implements a specific feature.
  #
  # `feature` The package name of the feature to test. In Level 1, the
  #           legal values are "HTML" and "XML" (case-insensitive).

Response:
# `version` This is the version number of the package name to test.
  #           In Level 1, this is the string "1.0". If the version is
  #           not specified, supporting any version of the feature will
  #           cause the method to return true.
  hasFeature: (feature, version) ->
    if feature.toUpper() is "XML" and version is "1.0"
      return true

    return false


Response:
xdescribe 'Actions: room', ->

  beforeEach ->
    @action = require 'actions/room'
    @api = require 'network/api'

  describe 'Method: fetch', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.readone, 'get').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.fetch(roomId)
      expect(@api.rooms.readone.get).toHaveBeenCalledWith config

  describe 'Method: roomJoin', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.join, 'post').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomJoin(roomId)
      expect(@api.rooms.join.post).toHaveBeenCalledWith config

  describe 'Method: roomLeave', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.leave, 'post').and.callThrough()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
xdescribe 'Actions: room', ->

  beforeEach ->
    @action = require 'actions/room'
    @api = require 'network/api'

  describe 'Method: fetch', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.readone, 'get').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.fetch(roomId)
      expect(@api.rooms.readone.get).toHaveBeenCalledWith config

  describe 'Method: roomJoin', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.join, 'post').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomJoin(roomId)
      expect(@api.rooms.join.post).toHaveBeenCalledWith config

  describe 'Method: roomLeave', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.leave, 'post').and.callThrough()
```

Response:
xdescribe('Actions: room', function() {
  beforeEach(function() {
    this.action = require('actions/room');
    return this.api = require('network/api');
  });
  describe('Method: fetch', function() {
    return it('should call api', function() {
      var config, roomId, userStore;
      userStore = require('store/user');
      spyOn(userStore, 'get').and.returnValue({});
      spyOn(this.api.rooms.readone, 'get').and.callThrough();
      roomId = 1;
      config = {
        pathParams: {
          id: roomId
        }
      };
      this.action.fetch(roomId);
      return expect(this.api.rooms.readone.get).toHaveBeenCalledWith(config);
    });
  });
  describe('Method: roomJoin', function() {
    return it('should call api', function() {
      var config, roomId, userStore;
      userStore = require('store/user');
      spyOn(userStore, 'get').and.returnValue({});
      spyOn(this.api.rooms.join, 'post').and.callThrough();
      roomId = 1;
      config = {
        pathParams: {
          id: roomId
        }
      };
      this.action.roomJoin(roomId);
      return expect(this.api.rooms.join.post).toHaveBeenCalledWith(config);
    });
  });
  return describe('Method: roomLeave', function() {
    return it('should call api', function() {
      var userStore;
      userStore = require('store/user');
      spyOn(userStore, 'get').and.returnValue({});
      return spyOn(this.api.rooms.leave, 'post').and.callThrough();
    });
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
xdescribe('Actions: room', function() {
  beforeEach(function() {
    this.action = require('actions/room');
    return this.api = require('network/api');
  });
  describe('Method: fetch', function() {
    return it('should call api', function() {
      var config, roomId, userStore;
      userStore = require('store/user');
      spyOn(userStore, 'get').and.returnValue({});
      spyOn(this.api.rooms.readone, 'get').and.callThrough();
      roomId = 1;
      config = {
        pathParams: {
          id: roomId
        }
      };
      this.action.fetch(roomId);
      return expect(this.api.rooms.readone.get).toHaveBeenCalledWith(config);
    });
  });
  describe('Method: roomJoin', function() {
    return it('should call api', function() {
      var config, roomId, userStore;
      userStore = require('store/user');
      spyOn(userStore, 'get').and.returnValue({});
      spyOn(this.api.rooms.join, 'post').and.callThrough();
      roomId = 1;
      config = {
        pathParams: {
          id: roomId
        }
      };
      this.action.roomJoin(roomId);
      return expect(this.api.rooms.join.post).toHaveBeenCalledWith(config);
    });
  });
  return describe('Method: roomLeave', function() {
    return it('should call api', function() {
      var userStore;
      userStore = require('store/user');
      spyOn(userStore, 'get').and.returnValue({});
      return spyOn(this.api.rooms.leave, 'post').and.callThrough();
    });
  });
});
```

Response:
xdescribe 'Actions: room', ->

  beforeEach ->
    @action = require 'actions/room'
    @api = require 'network/api'

  describe 'Method: fetch', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.readone, 'get').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.fetch(roomId)
      expect(@api.rooms.readone.get).toHaveBeenCalledWith config

  describe 'Method: roomJoin', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.join, 'post').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomJoin(roomId)
      expect(@api.rooms.join.post).toHaveBeenCalledWith config

  describe 'Method: roomLeave', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.leave, 'post').and.callThrough()


Prompt:
xdescribe 'Actions: room', ->

  beforeEach ->
    @action = require 'actions/room'
    @api = require 'network/api'

  describe 'Method: fetch', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.readone, 'get').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.fetch(roomId)
      expect(@api.rooms.readone.get).toHaveBeenCalledWith config

Response:
describe 'Method: roomJoin', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.join, 'post').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomJoin(roomId)
      expect(@api.rooms.join.post).toHaveBeenCalledWith config

  describe 'Method: roomLeave', ->
    it 'should call api', ->
      userStore = require 'store/user'
      spyOn(userStore, 'get').and.returnValue {}
      spyOn(@api.rooms.leave, 'post').and.callThrough()


Response:
roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomLeave(roomId)
      expect(@api.rooms.leave.post).toHaveBeenCalledWith config

  describe 'Method: roomInvite', ->
    it 'should call api with email', ->
      spyOn(@api.rooms.invite, 'post').and.callThrough()

      roomId = 1
      email = 'test@example.com'
      config =
        pathParams:
          id: roomId
        data:
          email: email

      @action.roomInvite(roomId, email)
      expect(@api.rooms.invite.post).toHaveBeenCalledWith config

    it 'should call api with userId', ->
      spyOn(@api.rooms.invite, 'post').and.callThrough()

      roomId = 1
      userId = '123'
      config =
        pathParams:
          id: roomId
        data:
          _userId: userId

      @action.roomInvite(roomId, userId)
      expect(@api.rooms.invite.post).toHaveBeenCalledWith config

  describe 'Method: roomCreate', ->
    it 'should call api', ->
      spyOn(@api.rooms.create, 'post').and.callThrough()


Prompt:
roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomLeave(roomId)
      expect(@api.rooms.leave.post).toHaveBeenCalledWith config

  describe 'Method: roomInvite', ->
    it 'should call api with email', ->
      spyOn(@api.rooms.invite, 'post').and.callThrough()

      roomId = 1
      email = 'test@example.com'
      config =
        pathParams:
          id: roomId
        data:
          email: email

Response:
@action.roomInvite(roomId, email)
      expect(@api.rooms.invite.post).toHaveBeenCalledWith config

    it 'should call api with userId', ->
      spyOn(@api.rooms.invite, 'post').and.callThrough()

      roomId = 1
      userId = '123'
      config =
        pathParams:
          id: roomId
        data:
          _userId: userId

      @action.roomInvite(roomId, userId)
      expect(@api.rooms.invite.post).toHaveBeenCalledWith config

  describe 'Method: roomCreate', ->
    it 'should call api', ->
      spyOn(@api.rooms.create, 'post').and.callThrough()


Response:
data = {}
      config = data: data

      @action.roomCreate(data)
      expect(@api.rooms.create.post).toHaveBeenCalledWith config

  describe 'Method: roomRemove', ->
    it 'should call api', ->
      spyOn(@api.rooms.remove, 'delete').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomRemove(roomId)
      expect(@api.rooms.remove.delete).toHaveBeenCalledWith config

  describe 'Method: roomRemoveMember', ->
    it 'should call api', ->
      spyOn(@api.rooms.removemember, 'post').and.callThrough()

      data =
        _roomId: 1
        _userId: 2
      config =
        pathParams:
          id: data._roomId
        data:
          _userId: data._userId

      @action.roomRemoveMember(data)
      expect(@api.rooms.removemember.post).toHaveBeenCalledWith config

  describe 'Method: roomArchive', ->
    it 'should call api', ->
      spyOn(@api.rooms.archive, 'post').and.callThrough()

      roomId = 1
      isArchived = true
      config =
        pathParams:
          id: roomId
        data:
          isArchived: isArchived


Prompt:
data = {}
      config = data: data

      @action.roomCreate(data)
      expect(@api.rooms.create.post).toHaveBeenCalledWith config

  describe 'Method: roomRemove', ->
    it 'should call api', ->
      spyOn(@api.rooms.remove, 'delete').and.callThrough()

      roomId = 1
      config =
        pathParams:
          id: roomId

      @action.roomRemove(roomId)
      expect(@api.rooms.remove.delete).toHaveBeenCalledWith config

  describe 'Method: roomRemoveMember', ->
    it 'should call api', ->
      spyOn(@api.rooms.removemember, 'post').and.callThrough()

Response:
data =
        _roomId: 1
        _userId: 2
      config =
        pathParams:
          id: data._roomId
        data:
          _userId: data._userId

      @action.roomRemoveMember(data)
      expect(@api.rooms.removemember.post).toHaveBeenCalledWith config

  describe 'Method: roomArchive', ->
    it 'should call api', ->
      spyOn(@api.rooms.archive, 'post').and.callThrough()

      roomId = 1
      isArchived = true
      config =
        pathParams:
          id: roomId
        data:
          isArchived: isArchived


Response:
@action.roomArchive(roomId, isArchived)
      expect(@api.rooms.archive.post).toHaveBeenCalledWith config

  describe 'Method: roomUpdate', ->
    it 'should call api', ->
      spyOn(@api.rooms.update, 'put').and.callThrough()

      roomId = 1
      data = {}
      config =
        pathParams:
          id: roomId
        data: data

      @action.roomUpdate(roomId, data)
      expect(@api.rooms.update.put).toHaveBeenCalledWith config

  describe 'Method: roomUpdateGuest', ->
    it 'should call api', ->
      spyOn(@api.rooms.guest, 'post').and.callThrough()

      roomId = 1
      enabled = true
      config =
        pathParams:
          id: roomId
        data:
          isGuestEnabled: enabled

      @action.roomUpdateGuest(roomId, enabled)
      expect(@api.rooms.guest.post).toHaveBeenCalledWith config


Prompt:
@action.roomArchive(roomId, isArchived)
      expect(@api.rooms.archive.post).toHaveBeenCalledWith config

  describe 'Method: roomUpdate', ->
    it 'should call api', ->
      spyOn(@api.rooms.update, 'put').and.callThrough()

      roomId = 1
      data = {}
      config =
        pathParams:
          id: roomId
        data: data

      @action.roomUpdate(roomId, data)

Response:
expect(@api.rooms.update.put).toHaveBeenCalledWith config

  describe 'Method: roomUpdateGuest', ->
    it 'should call api', ->
      spyOn(@api.rooms.guest, 'post').and.callThrough()

      roomId = 1
      enabled = true
      config =
        pathParams:
          id: roomId
        data:
          isGuestEnabled: enabled

      @action.roomUpdateGuest(roomId, enabled)
      expect(@api.rooms.guest.post).toHaveBeenCalledWith config


Response:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config
  ### The configuration object ###

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null
    # built product goes here
    output: './build'
    # base url that site lives on, e.g. '/blog/'
    baseUrl: '/'
    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080
    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once
    _restartOnConfChange: true # restart preview server on config change

  constructor: (options={}) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback


Prompt:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config
  ### The configuration object ###

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from

Response:
views: null
    # built product goes here
    output: './build'
    # base url that site lives on, e.g. '/blog/'
    baseUrl: '/'
    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080
    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once
    _restartOnConfChange: true # restart preview server on config change

  constructor: (options={}) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback


Response:
else
          callback new Error "Config file at '#{ path }' does not exist."
    (options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->
  ### Read config from *path* as JSON return a Config instance. ###
  if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Prompt:
else
          callback new Error "Config file at '#{ path }' does not exist."
    (options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->

Response:
### Read config from *path* as JSON return a Config instance. ###
  if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Response:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config
  ### The configuration object ###

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null
    # built product goes here
    output: './build'
    # base url that site lives on, e.g. '/blog/'
    baseUrl: '/'
    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080
    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options={}) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback
        else


Prompt:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config
  ### The configuration object ###

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from

Response:
views: null
    # built product goes here
    output: './build'
    # base url that site lives on, e.g. '/blog/'
    baseUrl: '/'
    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080
    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options={}) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback
        else


Response:
callback new Error "Config file at '#{ path }' does not exist."
    (options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->
  ### Read config from *path* as JSON return a Config instance. ###
  if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Prompt:
callback new Error "Config file at '#{ path }' does not exist."
    (options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->
  ### Read config from *path* as JSON return a Config instance. ###

Response:
if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Response:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null
    # built product goes here
    output: './build'
    # base url that site lives on, e.g. '/blog/'
    baseUrl: '/'
    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080
    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback
        else
          callback new Error "Config file at '#{ path }' does not exist."


Prompt:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null

Response:
# built product goes here
    output: './build'
    # base url that site lives on, e.g. '/blog/'
    baseUrl: '/'
    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080
    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback
        else
          callback new Error "Config file at '#{ path }' does not exist."


Response:
(options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->
  ### Read config from *path* as JSON return a Config instance. ###
  if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Prompt:
(options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->
  ### Read config from *path* as JSON return a Config instance. ###

Response:
if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Response:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null
    # built product goes here
    output: './build'

    # base url that site lives on, e.g. '/blog' or 'http://myplace.net/'
    baseUrl: '/'

    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080

    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists


Prompt:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # modules/files loaded and added to locals, name: module
    require: {}
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null

Response:
# built product goes here
    output: './build'

    # base url that site lives on, e.g. '/blog' or 'http://myplace.net/'
    baseUrl: '/'

    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080

    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists


Response:
readJSON path, callback
        else
          callback new Error "Config file at '#{ path }' does not exist."
    (options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->
  ### Read config from *path* as JSON return a Config instance. ###
  if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Prompt:
readJSON path, callback
        else
          callback new Error "Config file at '#{ path }' does not exist."
    (options, callback) ->
      config = new Config options
      config.__filename = path
      callback null, config
  ], callback

Config.fromFileSync = (path) ->

Response:
### Read config from *path* as JSON return a Config instance. ###
  if not fileExistsSync path
    throw new Error "Config file at '#{ path }' does not exist."
  config = new Config readJSONSync path
  config.__filename = path
  return config

### Exports ###

module.exports = {Config}


Response:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # list of modules/files loaded and added to locals
    require: []
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null
    # built product goes here
    output: './build'

    # base url that site lives on, e.g. '/blog' or 'http://myplace.net/'
    baseUrl: '/'

    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080

    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists


Prompt:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # list of modules/files loaded and added to locals
    require: []
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null

Response:
# built product goes here
    output: './build'

    # base url that site lives on, e.g. '/blog' or 'http://myplace.net/'
    baseUrl: '/'

    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080

    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists


Response:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # list of modules/files loaded and added to locals
    require: []
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null
    # built product goes here
    output: './build'

    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080

    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback
        else
          callback new Error "Config file at '#{ path }' does not exist."


Prompt:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  @defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # list of modules/files loaded and added to locals
    require: []
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null

Response:
# built product goes here
    output: './build'

    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080

    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of @constructor.defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback
        else
          callback new Error "Config file at '#{ path }' does not exist."


Response:
### config.coffee ###

fs = require 'fs'
path = require 'path'
async = require 'async'

{readJSON, readJSONSync, fileExists, fileExistsSync} = require './utils'

class Config

  defaults =
    # path to the directory containing content's to be scanned
    contents: './contents'
    # list of glob patterns to ignore
    ignore: []
    # context variables, passed to views/templates
    locals: {}
    # list of modules/files to load as plugins
    plugins: []
    # list of modules/files loaded and added to locals
    require: []
    # path to the directory containing the templates
    templates: './templates'
    # directory to load custom views from
    views: null
    # built product goes here
    output: './build'

    # preview server settings
    hostname: null # INADDR_ANY
    port: 8080

    # options prefixed with _ are undocumented and should generally not be modified
    _fileLimit: 40 # max files to keep open at once

  constructor: (options) ->
    for option, value of options
      this[option] = value
    for option, defaultValue of defaults
      this[option] ?= defaultValue

Config.fromFile = (path, callback) ->
  ### Read config from *path* as JSON and *callback* with a Config instance. ###
  async.waterfall [
    (callback) ->
      fileExists path, (exists) ->
        if exists
          readJSON path, callback
        else