Skip to content

Commit a529662

Browse files
committed
msdlon
1 parent e739571 commit a529662

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525

2626
"dependencies": {
2727
"github": "9.2.0",
28-
"seneca": "3.3.0",
28+
"seneca": "../seneca",
29+
"seneca-balance-client": "../seneca-balance-client",
30+
"seneca-monitor": "../seneca-monitor",
31+
"seneca-mesh": "../seneca-mesh",
2932
"seneca-entity": "2.0.0",
3033
"seneca-jsonfile-store": "1.0.0",
3134
"seneca-redis-transport": "0.3.0",

srv/github-dev-mesh.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* Copyright (c) 2014-2017 Richard Rodger and other contributors, MIT License */
2+
3+
var Seneca = require('seneca')
4+
5+
Seneca({tag: 'github'})
6+
.test()
7+
8+
.use('entity')
9+
.use('jsonfile-store', {folder: __dirname+'/../data'})
10+
11+
.use('../github.js')
12+
13+
.use('monitor')
14+
15+
.use('mesh', {
16+
listen: [
17+
{pin: 'role:github'},
18+
{pin: 'role:info,need:part', model:'observe'}
19+
]
20+
})
21+
22+
.add('role:info,need:part', function (msg, reply) {
23+
reply()
24+
25+
this.act(
26+
'role:github,cmd:get', {name:msg.name},
27+
function (err, mod) {
28+
if (err) return
29+
30+
if (mod) {
31+
return this.act('role:info,collect:part,part:github',
32+
{name:msg.name,data:this.util.clean(mod.data$())})
33+
}
34+
35+
this.act(
36+
'role:npm,cmd:get', {name:msg.name},
37+
function (err, mod) {
38+
if (err) return
39+
40+
if (mod) {
41+
this.act(
42+
'role:github,cmd:get', {name:msg.name, giturl:mod.giturl},
43+
function( err, mod ){
44+
if( err ) return
45+
46+
if( mod ) {
47+
this.act('role:info,collect:part,part:github',
48+
{name:msg.name,data:this.util.clean(mod.data$())})
49+
}
50+
})
51+
}
52+
})
53+
})
54+
})
55+

0 commit comments

Comments
 (0)