Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
language: node_js
node_js:
- 0.6
- 0.6
- 0.8
7 changes: 6 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

0.0.2 / 2012-01-21
0.0.3 / 2012-06-25
==================

* node 0.8

0.0.2 / 2012-01-21
==================

* Initial version.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ TESTS = test/*.test.js

test:
@NODE_ENV=test ./node_modules/.bin/mocha \
--require should \
--reporter spec \
$(TESTS)

.PHONY: test
.PHONY: test
17 changes: 16 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
[![Build Status](https://secure.travis-ci.org/vesln/bot.png)](http://travis-ci.org/vesln/bot)

# Important Notice

I'm no longer actively maintaining this project. If you are interested supporting it - [ping me on twitter](https://twitter.com/vesln).
The only thing that I will ask you is to not change the API drastically. If you are planning on doing that - better start a brand new project.

If you want me to transfer you only the name on npm, I'd be happy to only if the project **does not have any downloads on npm lately**. In case it's being
downloaded, there are people that depend on it and might step up and start maintaining, so I will not transfer it to you, regardless if you want to release
a new major version etc.

If you have any other questions, let me know.

Thanks!

Veselin

# Bot

![screenshot](http://img850.imageshack.us/img850/79/screenshot20120121at637.png)
Expand Down Expand Up @@ -64,4 +79,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "bot"
, "preferGlobal": "true"
, "version": "0.0.2"
, "version": "0.0.3"
, "description": "Feeling lonely? You personal bot is here."
, "keywords": ["bot", "chat bot"]
, "author": "Veselin Todorov <hi@vesln.com>"
, "dependencies": {
"colors": "0.6.0-1"
}
, "devDependencies": {
"mocha": "0.3.3"
, "should": "0.3.2"
"mocha": "*"
, "chai": "*"
}
, "repository" : {
"type" : "git"
Expand All @@ -24,7 +24,7 @@
"bot": "./bin/bot"
}
, "main": "./lib/index"
, "engines": {
"node": ">= 0.6.0 < 0.7.0"
, "engines": {
"node": ">= 0.6.0"
}
}
}
21 changes: 13 additions & 8 deletions test/bot.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/*!
* Bot - Feeling lonely? You personal bot is here.
*
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

/**
* The tested class.
*
* Support.
*/
var should = require('chai').should();

/**
* Subject.
*
* @type {Function}
*/
var Bot = require('../lib/bot');
Expand All @@ -24,26 +29,26 @@ describe('Bot', function() {
Bot.version.should.be.ok;
});
});

describe('constructor', function() {
it('should load db and defaults', function() {
it('should load db and defaults', function() {
var bot = new Bot({foo: 'bar'}, ['foo', 'bar']);
bot._db.should.eql({foo: 'bar'});
bot._defaults.should.eql(['foo', 'bar']);
});
});

describe('.answer()', function() {
it('should answer questions', function() {
var db = new Db;
var bot = new Bot(db);
bot.answer('Hello.').should.eql('"Hello," he lied.');
});

it('should answer even if he does not know what to say', function() {
var db = new Db;
var bot = new Bot(db, ['foo']);
bot.answer('dasjdisahdia').should.eql('foo');
});
});
});
});
21 changes: 14 additions & 7 deletions test/db.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/*!
* Bot - Feeling lonely? You personal bot is here.
*
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

/**
* The tested class.
*
* Support.
*/
var should = require('chai').should();

/**
* Subject.
*
* @type {Function}
*/
var Db = require('../lib/db');
Expand All @@ -23,29 +28,31 @@ describe('Db', function() {
var db = new Db;
(!!db._content).should.be.ok;
});

it('should use the supplied content', function() {
var content = {foo: 'bar'};
var db = new Db(content);
db._content.should.eql(content);
});
});

describe('.findOne()', function() {
it('should find the most accurate answer for text', function() {
var text = new Text('People are crazy.');
var db = new Db;
db.findOne(text).should.eql('During these times, when crazy people are running the government, all you can do is laugh.');
});
});

describe('.findAll()', function() {
it('should find all matches for text', function() {
var text = new Text('Bears are crazy.');
var db = new Db;
var result = db.findAll(text);

result.should.be.an.array;

(result.length > 0).should.be.true;
});
});
});
});
15 changes: 10 additions & 5 deletions test/text.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/*!
* Bot - Feeling lonely? You personal bot is here.
*
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

/**
* The tested class.
*
* Support.
*/
var should = require('chai').should();

/**
* Subject.
*
* @type {Function}
*/
var Text = require('../lib/text');
Expand All @@ -19,11 +24,11 @@ describe('Text', function() {
text._text.should.eql('Hello!');
});
});

describe('.words()', function() {
it('should remove stop words', function() {
var text = new Text('I love her. Am I an idiot?');
text.words().should.eql(['i', 'love', 'i', 'idiot']);
});
});
});
});