1
0
mirror of https://github.com/balkian/hook.io-web40.git synced 2025-01-05 02:41:30 +00:00

First commit

This commit is contained in:
J.Fernando Sánchez 2012-05-25 11:23:09 +02:00
commit c679d498f4
6 changed files with 65 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
tests
configuration
node_modules
*.bak
*.swp
SOJA

13
bin/hook.io-web40 Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env node
require('coffee-script');
var Hook = require('../lib/hook.io-web40').Web40Hook;
var hook = new Hook({
name: "Web40Hook"
});
// Hook.start defaults to localhost
// it can accept dnode constructor options ( for remote connections )
// these hooks can be started on diffirent machines / networks / devices
hook.connect();

1
config.json Normal file
View File

@ -0,0 +1 @@
{}

2
index.js Normal file
View File

@ -0,0 +1,2 @@
require('coffee-script');
module.exports = require('./lib/hook.io-web40');

19
lib/hook.io-web40.coffee Normal file
View File

@ -0,0 +1,19 @@
# Imports
Hook = require('hook.io').Hook
class Web40Hook extends Hook
constructor: (options) ->
self = this
Hook.call(self, options)
self.on 'hook::ready', ->
self.on '*::kill', (data,fn) ->
if data? && data == self.name
console.log "Shutting down, Sir"
fn(true)
self.kill()
self.on '*::ping', (data,fn) ->
self.emit 'pong', {'name':self.name}
fn(self.name)
module.exports.Web40Hook = Web40Hook

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"author": "J.Fernando Sánchez <balkian@gmail.com>",
"name": "hook.io-web40",
"description": "Basic hook for the web4.0 project",
"keywords" : [ "hook", "hook.io" ],
"version": "0.0.1",
"bugs" : { "url" : "http://github.com/balkian/hook.io-web40/issues" },
"repository": {
"type": "git",
"url": "git://github.com/balkian/hook.io-web40.git"
},
"bin": {
"hookio-mailer": "./bin/hook.io-web40"
},
"main": "./lib/hook.io-web40",
"engines": {
"node": ">= v0.4.7"
},
"dependencies": {
"hook.io" : ">= 0.8",
"coffee-script" : "*"
},
"devDependencies": {}
}