Skip to content

Commit

Permalink
Merge pull request nandub#84 from nandub/feature/enable-grunt
Browse files Browse the repository at this point in the history
Enable Grunt
  • Loading branch information
jgable committed Jun 15, 2013
2 parents 5ffe304 + 0e3ee5c commit 54bcfa3
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
lib
*.tgz

node_modules
61 changes: 61 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#global module:false
module.exports = (grunt) ->

# Project configuration.
grunt.initConfig
watch:
files: ["src/**/*.coffee"]
tasks: ["coffee", "jshint"]

nodeunit: {
all: ['test/**/*_test.js']
}

jshint:
files: ["Gruntfile.js", "src/**/*.js", "test/**/*.js"]
options:
curly: true
eqeqeq: true
immed: true
latedef: true
newcap: true
noarg: true
sub: true
undef: true
boss: true
eqnull: true

globals:
jQuery: true
require: true
module: true
process: true

coffee:
compile:
files:
"lib/irc.js": "src/irc.coffee"

coffeelint:
client: ["src/**/*.coffee"]
options:
indentation:
value: 2
level: 'error'
no_empty_param_list:
level: 'ignore'
no_implicit_braces:
level: 'ignore'
no_implicit_parens:
level: 'ignore'
max_line_length:
level: 'ignore'

grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-jshint"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-nodeunit"
grunt.loadNpmTasks "grunt-coffeelint"

# Default task.
grunt.registerTask "default", ["coffee", "jshint", "coffeelint"]
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@
"dependencies": {
"irc": "0.3.6"
},
"devDependencies": {}
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-coffee": "~0.6.2",
"grunt-contrib-jshint": "~0.3.0",
"grunt-contrib-watch": "~0.3.1",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-coffeelint": "~0.0.6"
}
}
22 changes: 11 additions & 11 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ class IrcBot extends Adapter
return @userForId id

createUser: (channel, from) ->
user = @getUserFromName from
unless user?
id = new Date().getTime().toString()
user = @getUserFromId id
user.name = from

if channel.match(/^[&#]/)
user.room = channel
else
user.room = null
user
user = @getUserFromName from
unless user?
id = new Date().getTime().toString()
user = @getUserForId id
user.name = from

if channel.match(/^[&#]/)
user.room = channel
else
user.room = null
user

kick: (channel, client, message) ->
@bot.emit 'raw',
Expand Down

0 comments on commit 54bcfa3

Please sign in to comment.