Permalink
Browse files

[minor] Fix whitespace

  • Loading branch information...
1 parent 54eff94 commit 64f7a42c0747c671651e0f9d5a12d9388db17106 @pksunkara pksunkara committed Apr 14, 2012
@@ -1,10 +1,10 @@
/*
- * add-properties.js: Example of how to add properties to an object using prompt.
+ * add-properties.js: Example of how to add properties to an object using prompt.
*
* (C) 2010, Nodejitsu Inc.
*
*/
-
+
var prompt = require('../lib/prompt');
//
@@ -1,10 +1,10 @@
/*
- * existing-properties.js: Example of using prompt with predefined properties.
+ * existing-properties.js: Example of using prompt with predefined properties.
*
* (C) 2010, Nodejitsu Inc.
*
*/
-
+
var prompt = require('../lib/prompt');
prompt.properties = {
View
@@ -1,10 +1,10 @@
/*
- * history.js: Example of using the prompt history capabilities.
+ * history.js: Example of using the prompt history capabilities.
*
* (C) 2010, Nodejitsu Inc.
*
*/
-
+
var prompt = require('../lib/prompt');
//
@@ -14,17 +14,17 @@ prompt.start();
var properties = [
{
- name: 'animal',
+ name: 'animal',
description: 'Enter an animal',
default: 'dog',
validator: /dog|cat/
},
{
- name: 'sound',
+ name: 'sound',
description: 'What sound does this animal make?',
validator: function (value) {
var animal = prompt.history(0).value;
-
+
return animal === 'dog' && value === 'woof'
|| animal === 'cat' && value === 'meow';
}
View
@@ -15,9 +15,9 @@ prompt.start();
//
// Get two properties from the user: username and password
//
-prompt.get([{
- name:'password',
- hidden: true,
+prompt.get([{
+ name:'password',
+ hidden: true,
validator: function (value, next) {
setTimeout(next, 200);
}
@@ -1,15 +1,15 @@
/*
- * property-prompt.js: Example of using prompt with complex properties.
+ * property-prompt.js: Example of using prompt with complex properties.
*
* (C) 2010, Nodejitsu Inc.
*
*/
-
+
var prompt = require('../lib/prompt');
var properties = [
{
- name: 'name',
+ name: 'name',
validator: /^[a-zA-Z\s-]+$/,
warning: 'Name must be only letters, spaces, or dashes',
empty: false
@@ -1,10 +1,10 @@
/*
- * simple-prompt.js: Simple example of using prompt.
+ * simple-prompt.js: Simple example of using prompt.
*
* (C) 2010, Nodejitsu Inc.
*
*/
-
+
var prompt = require('../lib/prompt');
//
View
@@ -79,7 +79,7 @@ prompt.start = function (options) {
process.on('SIGINT', function () {
stdout.write('\n');
process.exit(1);
- });
+ });
}
prompt.emit('start');
@@ -376,14 +376,14 @@ prompt.readLine = function (callback) {
//
prompt.readLineHidden = function (callback) {
var value = '';
-
+
//
// Ignore errors from `.setRawMode()` so that `prompt` can
// be scripted in child processes.
//
try { tty.setRawMode(true) }
catch (ex) { }
-
+
prompt.resume();
stdin.on('error', callback);
stdin.on('data', function data (line) {
View
@@ -70,17 +70,17 @@ helpers.properties = {
validator: ['cant', 'use', 'array']
},
animal: {
- name: 'animal',
+ name: 'animal',
description: 'Enter an animal',
default: 'dog',
validator: /dog|cat/
},
sound: {
- name: 'sound',
+ name: 'sound',
description: 'What sound does this animal make?',
validator: function (value) {
var animal = prompt.history(0).value;
-
+
return animal === 'dog' && value === 'woof'
|| animal === 'cat' && value === 'meow';
}
@@ -1,10 +1,10 @@
/*
- * prompt-test.js: Tests for prompt.
+ * prompt-test.js: Tests for prompt.
*
* (C) 2010, Nodejitsu Inc.
*
*/
-
+
var assert = require('assert'),
vows = require('vows'),
prompt = require('../lib/prompt'),
View
@@ -273,8 +273,8 @@ vows.describe('prompt').addBatch({
"skip prompt with prompt.overide": {
topic: function () {
prompt.override = { coconihet: 'whatever' }
- prompt.get('coconihet', this.callback);
- },
+ prompt.get('coconihet', this.callback);
+ },
"skips prompt and uses overide": function (err, results) {
assert.equal(results.coconihet, 'whatever')
}

0 comments on commit 64f7a42

Please sign in to comment.