Comparing version 0.2.1 to 0.2.2
@@ -125,3 +125,5 @@ /** | ||
this.rl.emit( "keypress", s, key ); | ||
if ( this.rl ) { | ||
this.rl.emit( "keypress", s, key ); | ||
} | ||
}.bind(cli); | ||
@@ -128,0 +130,0 @@ |
{ | ||
"name": "inquirer", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -5,0 +5,0 @@ "main": "lib/inquirer.js", |
@@ -13,3 +13,3 @@ Inquirer.js [![Build Status](https://travis-ci.org/SBoudrias/Inquirer.js.png?branch=master)](http://travis-ci.org/SBoudrias/Inquirer.js) | ||
_Inquirer_ should ease the process of asking end user questions, parsing, validating answers, and providing error feedback. | ||
_Inquirer_ should ease the process of asking end user **questions**, **parsing**, **validating** answers, managing **hierarchical prompts** and providing **error feedback**. | ||
@@ -190,8 +190,3 @@ _Inquirer_ provide the user interface, and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [Commander.js](https://github.com/visionmedia/commander.js) (inspired by) or [Cli-color](https://github.com/medikoo/cli-color) (used internally). | ||
+ **0.1.7** : Add a hierarchical prompt API with `when`, allow lists from having a default | ||
+ **0.1.6** : Fix bug on unix and minor enhancement | ||
+ **0.1.5** : Enhance visual style; prompts are now more succint. Lots of bug fixes. | ||
+ **0.1.3** : Add async support for validation and filtering functions. | ||
+ **0.1.0** : First official release. There's 4 prompt types: `input`, `confirm`, `list` and | ||
`rawlist`. There's functionnality to allow the validation of input, and the filtering of values. | ||
Please refer to the [Github releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases) | ||
@@ -207,2 +202,3 @@ | ||
or better docs! | ||
**Pull Requests**: Send _fixes_ PR on the `master` branch. Any new features should be send on the `wip`branch. | ||
@@ -209,0 +205,0 @@ We're looking to offer good support for multiples prompt and environments. If you want to |
@@ -9,3 +9,10 @@ /** | ||
var ReadlineStub = require("../helpers/readline"); | ||
var inquirer = require("../../lib/inquirer"); | ||
var proxyquire = require("proxyquire"); | ||
var inquirer = proxyquire("../../lib/inquirer", { | ||
"./utils/readline": { | ||
createInterface: function() { | ||
return new ReadlineStub(); | ||
} | ||
} | ||
}); | ||
@@ -15,9 +22,5 @@ | ||
beforeEach(function() { | ||
inquirer.rl = new ReadlineStub(); | ||
}); | ||
it("should close and create a new readline instances each time it's called", function( done ) { | ||
var rl1; | ||
it("should resume and close readline", function( done ) { | ||
var rl = inquirer.rl; | ||
inquirer.prompt({ | ||
@@ -28,7 +31,7 @@ type: "confirm", | ||
}, function( answers ) { | ||
expect(rl.resume.called).to.be.true; | ||
expect(rl.close.called).to.be.true; | ||
expect(inquirer.rl).to.be.null; | ||
var rl2; | ||
rl = inquirer.rl = new ReadlineStub(); | ||
expect(rl1.close.called).to.be.true; | ||
expect(inquirer.rl).to.not.exist; | ||
inquirer.prompt({ | ||
@@ -39,12 +42,15 @@ type: "confirm", | ||
}, function( answers ) { | ||
expect(rl.resume.called).to.be.true; | ||
expect(rl.close.called).to.be.true; | ||
expect(inquirer.rl).to.be.null; | ||
expect(rl2.close.called).to.be.true; | ||
expect(inquirer.rl).to.not.exist; | ||
expect( rl1 ).to.not.equal( rl2 ); | ||
done(); | ||
}); | ||
rl2 = inquirer.rl; | ||
inquirer.rl.emit("line"); | ||
}); | ||
rl.emit("line"); | ||
rl1 = inquirer.rl; | ||
inquirer.rl.emit("line"); | ||
@@ -51,0 +57,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
190635
70
4312
213