From 30b018833c3e3ab7092fe5bea96f02d5fec9e292 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Fri, 24 Feb 2012 20:03:58 +0100 Subject: [PATCH] Added a simple test plugin that doesn't do much --- .../pluginomatic_fintest/.npmignore | 7 ++++ .../pluginomatic_fintest/otherpart.js | 13 ++++++++ .../pluginomatic_fintest/package.json | 9 ++++++ .../pluginomatic_fintest/partlast.js | 3 ++ .../pluginomatic_fintest/pluginomatic.json | 32 +++++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 available_plugins/pluginomatic_fintest/.npmignore create mode 100644 available_plugins/pluginomatic_fintest/otherpart.js create mode 100644 available_plugins/pluginomatic_fintest/package.json create mode 100644 available_plugins/pluginomatic_fintest/partlast.js create mode 100644 available_plugins/pluginomatic_fintest/pluginomatic.json diff --git a/available_plugins/pluginomatic_fintest/.npmignore b/available_plugins/pluginomatic_fintest/.npmignore new file mode 100644 index 00000000..74bd365b --- /dev/null +++ b/available_plugins/pluginomatic_fintest/.npmignore @@ -0,0 +1,7 @@ +.git* +docs/ +examples/ +support/ +test/ +testing.js +.DS_Store diff --git a/available_plugins/pluginomatic_fintest/otherpart.js b/available_plugins/pluginomatic_fintest/otherpart.js new file mode 100644 index 00000000..f2a94d35 --- /dev/null +++ b/available_plugins/pluginomatic_fintest/otherpart.js @@ -0,0 +1,13 @@ +exports.somehook = function (hook_name, args, cb) { + return cb(["otherpart:somehook was here"]); +} + +exports.morehook = function (hook_name, args, cb) { + return cb(["otherpart:morehook was here"]); +} + +exports.expressServer = function (hook_name, args, cb) { + args.app.get('/otherpart', function(req, res) { + res.send("Abra cadabra"); + }); +} diff --git a/available_plugins/pluginomatic_fintest/package.json b/available_plugins/pluginomatic_fintest/package.json new file mode 100644 index 00000000..d5b0531b --- /dev/null +++ b/available_plugins/pluginomatic_fintest/package.json @@ -0,0 +1,9 @@ +{ + "name": "pluginomatic_fintest", + "description": "A test plugin", + "version": "0.0.1", + "author": "RedHog (Egil Moeller) ", + "contributors": [], + "dependencies": {}, + "engines": { "node": ">= 0.4.1 < 0.7.0" } +} diff --git a/available_plugins/pluginomatic_fintest/partlast.js b/available_plugins/pluginomatic_fintest/partlast.js new file mode 100644 index 00000000..c3f1fc3e --- /dev/null +++ b/available_plugins/pluginomatic_fintest/partlast.js @@ -0,0 +1,3 @@ +exports.somehook = function (hook_name, args, cb) { + return cb(["partlast:somehook was here"]); +} diff --git a/available_plugins/pluginomatic_fintest/pluginomatic.json b/available_plugins/pluginomatic_fintest/pluginomatic.json new file mode 100644 index 00000000..3b34c7ce --- /dev/null +++ b/available_plugins/pluginomatic_fintest/pluginomatic.json @@ -0,0 +1,32 @@ +{ + "parts": [ + { + "name": "somepart", + "pre": [], + "post": ["pluginomatic_onemoreplugin/partone"] + }, + { + "name": "partlast", + "pre": ["pluginomatic_fintest/otherpart"], + "post": [], + "hooks": { + "somehookname": "pluginomatic_fintest/partlast:somehook" + } + }, + { + "name": "partfirst", + "pre": [], + "post": ["pluginomatic_onemoreplugin/somepart"] + }, + { + "name": "otherpart", + "pre": ["pluginomatic_fintest/somepart", "pluginomatic_otherplugin/main"], + "post": [], + "hooks": { + "somehookname": "pluginomatic_fintest/otherpart:somehook", + "morehook": "pluginomatic_fintest/otherpart:morehook", + "expressServer": "pluginomatic_fintest/otherpart:expressServer" + } + } + ] +}