Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add travis with lint and tests #271

Merged
24 commits merged into from
Jan 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d4d3a6d
feature(CI): Add travis.yml file.
jirwin Jan 6, 2015
6a60e82
fix(lint): Various fixes to get lint to pass
jirwin Jan 6, 2015
71e9f0e
Because travis runs an older version of npm for node 0.8.x, force npm…
jirwin Jan 6, 2015
9e2d0cd
Drop jshint for jscs
jirwin Jan 6, 2015
4c33381
fix(lint): Remove padding in if statements.
jirwin Jan 6, 2015
9eb6538
fix(lint): Set indentation to 4 spaces instead of 2.
jirwin Jan 6, 2015
8a601e8
fix(lint): Fix 'Extra comma following the final element of an array o…
jirwin Jan 6, 2015
9bd3661
fix(jscs): Don't require on var statement per block.
jirwin Jan 6, 2015
73ca582
fix(lint): Remove padding on anonymous function declarations.
jirwin Jan 6, 2015
c0e3acf
fix(lint): Use single quotes everywhere consistently
jirwin Jan 6, 2015
23d3577
fix(lint): Fix 'Empty block found' errors
jirwin Jan 6, 2015
53d6400
fix(lint): Fix 'Illegal space after key' error
jirwin Jan 6, 2015
134b2fd
fix(lint): Use unquoted object literals where possible. Fixes 'Extra …
jirwin Jan 6, 2015
04ada3a
fix(lint): Allow object properties to not be camelCased.
jirwin Jan 6, 2015
fc3a45f
fix(lint): Fix 'All identifiers must be camelCase or UPPER_CASE' error
jirwin Jan 6, 2015
3d59532
fix(lint): Fix 'Missing space after if keyword' error
jirwin Jan 6, 2015
3f840ac
fix(lint): Set 'self' to be the safe context keyword.
jirwin Jan 6, 2015
7f363d2
fix(lint): Fix remaining 'Illegal space' errors.
jirwin Jan 6, 2015
29e5c15
fix(lint): Fix indentation errors.
jirwin Jan 6, 2015
ebf96f4
fix(lint): Fix 'Missing space' errors.
jirwin Jan 6, 2015
66bc771
fix(lint): Fix 'Missing newline after/before curly braces' error. Mul…
jirwin Jan 6, 2015
90e6d16
fix(lint): Fix missing spaces around operators.
jirwin Jan 6, 2015
8648669
fix(lint): Remove extra newlines to fix 'Multiple line break' error
jirwin Jan 6, 2015
3ceeac5
fix(lint): Place quotes around keys that begin with zeroes so they ar…
jirwin Jan 7, 2015
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
6 changes: 6 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"validateIndentation": 4,
"requireMultipleVarDecl": null,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"safeContextKeyword": "self"
}
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- "0.10"
- "0.8"
before_install:
- npm install -g npm
script:
- "npm run-script lint"
- "npm test"
21 changes: 11 additions & 10 deletions example/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,35 @@ var irc = require('../');

var bot = new irc.Client('irc.dollyfish.net.nz', 'nodebot', {
debug: true,
channels: ['#blah', '#test'],
channels: ['#blah', '#test']
});

bot.addListener('error', function(message) {
console.error('ERROR: %s: %s', message.command, message.args.join(' '));
});

bot.addListener('message#blah', function (from, message) {
bot.addListener('message#blah', function(from, message) {
console.log('<%s> %s', from, message);
});

bot.addListener('message', function (from, to, message) {
bot.addListener('message', function(from, to, message) {
console.log('%s => %s: %s', from, to, message);

if ( to.match(/^[#&]/) ) {
if (to.match(/^[#&]/)) {
// channel message
if ( message.match(/hello/i) ) {
if (message.match(/hello/i)) {
bot.say(to, 'Hello there ' + from);
}
if ( message.match(/dance/) ) {
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D\\-<\u0001") }, 1000);
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D|-<\u0001") }, 2000);
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D/-<\u0001") }, 3000);
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D|-<\u0001") }, 4000);
if (message.match(/dance/)) {
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D\\-<\u0001'); }, 1000);
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 2000);
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D/-<\u0001'); }, 3000);
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 4000);
}
}
else {
// private message
console.log('private message');
}
});
bot.addListener('pm', function(nick, message) {
Expand Down
21 changes: 11 additions & 10 deletions example/secure.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,35 @@ var bot = new irc.Client('chat.us.freenode.net', 'nodebot', {
port: 6697,
debug: true,
secure: options,
channels: ['#botwar'],
channels: ['#botwar']
});

bot.addListener('error', function(message) {
console.error('ERROR: %s: %s', message.command, message.args.join(' '));
});

bot.addListener('message#blah', function (from, message) {
bot.addListener('message#blah', function(from, message) {
console.log('<%s> %s', from, message);
});

bot.addListener('message', function (from, to, message) {
bot.addListener('message', function(from, to, message) {
console.log('%s => %s: %s', from, to, message);

if ( to.match(/^[#&]/) ) {
if (to.match(/^[#&]/)) {
// channel message
if ( message.match(/hello/i) ) {
if (message.match(/hello/i)) {
bot.say(to, 'Hello there ' + from);
}
if ( message.match(/dance/) ) {
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D\\-<\u0001") }, 1000);
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D|-<\u0001") }, 2000);
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D/-<\u0001") }, 3000);
setTimeout(function () { bot.say(to, "\u0001ACTION dances: :D|-<\u0001") }, 4000);
if (message.match(/dance/)) {
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D\\-<\u0001'); }, 1000);
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 2000);
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D/-<\u0001'); }, 3000);
setTimeout(function() { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 4000);
}
}
else {
// private message
console.log('private message');
}
});
bot.addListener('pm', function(nick, message) {
Expand Down
Loading