Commits

Sean Wilkinson  committed 15e880a Merge

Merge pull request #4 from qmachine/master

Now using Git submodules

  • Participants
  • Parent commits 9269e97, ec74bc1

Comments (0)

Files changed (30)

+[submodule "src/npm-package"]
+	path = src/npm-package
+	url = https://github.com/qmachine/qm-nodejs.git
+[submodule "src/ruby-gem"]
+	path = src/ruby-gem
+	url = https://github.com/qmachine/qm-ruby.git
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "[]" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
                 QM_WWW_STRING='"$(BUILD_DIR)/local-sandbox/katamari.json"'  \
                     $(NPM) start
 
-npm-package: $(BUILD_DIR)/npm-package/README.md
-	@   $(CD) $(dir $<)                                             ;   \
+npm-package: | $(BUILD_DIR)/npm-package/
+	@   $(CD) $(BUILD_DIR)/npm-package/                             ;   \
             $(NPM) install                                              ;   \
             $(NPM) shrinkwrap                                           ;   \
             $(call hilite, 'Created $@.')
             $(BUNDLE) package                                           ;   \
             $(BUNDLE) exec rackup
 
-ruby-gem: $(BUILD_DIR)/ruby-gem/README.md
+ruby-gem: | $(BUILD_DIR)/ruby-gem/
 	@   $(CD) $(BUILD_DIR)/ruby-gem/                                ;   \
             $(GEM) build qm.gemspec
 
 
 [![Build Status](https://drone.io/github.com/wilkinson/qmachine/status.png)](https://drone.io/github.com/wilkinson/qmachine/latest)
 
-<!--
-<a href="https://runnable.com/qmachine" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png" style="width:67px;height:25px;"></a>
--->
-

File src/bower-package/bower.json

         "bootstrap": "2.3.1",
         "coffee-script": "1.6.2",
         "jquery": "1.9.1",
-        "quanah": "0.1.6"
+        "quanah": "0.1.7"
     },
     "main": [
         "./src/browser-client/qmachine.js",
         "./src/browser-client/style.css"
     ],
     "name": "qm",
-    "version": "1.0.0"
+    "version": "1.0.1"
 }

File src/browser-client/manifest.webapp

     "name": "QMachine",
     "permissions": {},
     "type": "web",
-    "version": "1.0.0"
+    "version": "1.0.1"
 }

File src/chrome-hosted-app/manifest.json

     "permissions": [
         "unlimitedStorage"
     ],
-    "version": "1.0.0"
+    "version": "1.0.1"
 }

Submodule src/npm-package

+Subproject commit f52d4bf3ff3cb2518db6382e77d9a8fb2afad4c1

File src/npm-package/.npmignore

-#-  NPM configuration file
-
-#-  .npmignore ~~
-#                                                       ~~ (c) SRW, 18 Sep 2012
-
-.hgignore
-
-#-  vim:set syntax=gitconfig:

File src/npm-package/examples/client.js

-//- JavaScript source code
-
-//- client.js ~~
-//                                                      ~~ (c) SRW, 28 Jun 2012
-//                                                  ~~ last updated 12 Nov 2012
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
- // Declarations
-
-    var qm;
-
- // Definitions
-
-    qm = require('lib/main');
-
- // Invocations
-
-    qm.launch_client({
-        hostname:   '127.0.0.1',
-        port:       8177
-    });
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/examples/roll-up.js

-//- JavaScript source code
-
-//- roll-up.js ~~
-//
-//  NOTE: This file isn't just an example -- it is also used as part of the
-//  QM project's build process :-)
-//
-//                                                      ~~ (c) SRW, 17 Dec 2012
-//                                                  ~~ last updated 21 Dec 2012
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
- // Declarations
-
-    var directory, json_file;
-
- // Definitions
-
-    directory = (process.argv.length > 2) ? process.argv[2] : 'public_html';
-
-    json_file = (process.argv.length > 3) ? process.argv[3] : 'katamari.json';
-
- // Demonstration
-
-    require('../').roll_up(directory, json_file);
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/examples/service.js

-//- JavaScript source code
-
-//- service.js ~~
-//                                                      ~~ (c) SRW, 26 Sep 2012
-//                                                  ~~ last updated 15 May 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
- // Declarations
-
-    var examples, qm;
-
- // Definitions
-
-    examples = {
-        max_http_sockets:   1000,
-        persistent_storage: {
-            avar_ttl:       60,
-            couch:          'http://127.0.0.1:5984/db',
-            gc_interval:    1,
-            mongo:          'mongodb://localhost:27017/qm',
-            postgres:       'postgres://localhost:5432/' + process.env.USER,
-            redis:          'redis://:@127.0.0.1:6379',
-            sqlite:         'qm.db'
-        },
-        trafficlog_storage: {
-            couch:          'http://127.0.0.1:5984/traffic',
-            mongo:          'mongodb://localhost:27017/qm'
-        },
-        worker_procs:       require('os').cpus().length
-    };
-
-    qm = require('lib/main');
-
- // Invocations
-
-    qm.launch_service({
-        enable_api_server:  true,
-        enable_CORS:        true,
-        enable_www_server:  true,
-        persistent_storage: {
-            avar_ttl:       60,
-            mongo:          examples.persistent_storage.mongo
-        },
-        trafficlog_storage: {
-            mongo:          examples.trafficlog_storage.mongo
-        },
-        worker_procs:       0
-    });
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/client.js

-//- JavaScript source code
-
-//- client.js ~~
-//                                                      ~~ (c) SRW, 25 Aug 2012
-//                                                  ~~ last updated 01 Apr 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jshint maxparams: 1, quotmark: single, strict: true */
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
-    /*properties launch */
-
- // Out-of-scope definitions
-
-    exports.launch = function () {
-     // This function needs documentation.
-        throw new Error('The Node.js "native" client is under construction.');
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/configure.js

-//- JavaScript source code
-
-//- configure.js ~~
-//                                                      ~~ (c) SRW, 17 Dec 2012
-//                                                  ~~ last updated 01 Apr 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jshint maxparams: 2, quotmark: single, strict: true */
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
-    /*properties exports, hasOwnProperty */
-
- // Out-of-scope definitions
-
-    module.exports = function configure(user_input, default_values) {
-     // This function needs documentation.
-        if ((user_input instanceof Object) === false) {
-            user_input = {};
-        }
-        var key, y;
-        y = (default_values instanceof Array) ? [] : user_input;
-        for (key in default_values) {
-            if (default_values.hasOwnProperty(key)) {
-                if (default_values[key] instanceof Object) {
-                    y[key] = configure(user_input[key], default_values[key]);
-                } else if (user_input.hasOwnProperty(key)) {
-                    y[key] = user_input[key];
-                } else {
-                    y[key] = default_values[key];
-                }
-            }
-        }
-        return y;
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/couch-api-ddoc.js

-//- JavaScript source code
-
-//- couch-api-ddoc.js ~~
-//                                                      ~~ (c) SRW, 23 Oct 2012
-//                                                  ~~ last updated 20 May 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*global exports: false, getRow: false, send: false */
-
-    /*jshint maxparams: 2, quotmark: single, strict: true */
-
-    /*jslint couch: true, indent: 4, maxlen: 80, nomen: true, unparam: true */
-
-    /*properties
-        'as-array', body, box_status, 'Content-Type', data, _deleted, exp_date,
-        hasOwnProperty, headers, _id, jobs, key, lists, map, outdated, parse,
-        _rev, shows, split, stringify, updates, upsert, value, views
-    */
-
- // Out-of-scope definitions
-
-    exports._id = '_design/app';
-
-    exports.lists = {
-        'as-array': function () {
-         // This function needs documentation.
-            var first, row;
-            first = true;
-            row = getRow();
-            send('[');
-            while (row !== null) {
-                if (first === true) {
-                    first = false;
-                    send(JSON.stringify(row.value));
-                } else {
-                    send(',' + JSON.stringify(row.value));
-                }
-                row = getRow();
-            }
-            send(']');
-            return;
-        }
-    };
-
-    exports.shows = {
-        data: function (doc) {
-         // This function needs documentation.
-            var response;
-            response = {
-                headers: {
-                    'Content-Type': 'application/json'
-                }
-            };
-            if ((doc === null) || (doc.hasOwnProperty('body') === false)) {
-             // If a document with the requested docid doesn't exist, return a
-             // plain old JSON object to avoid giving [evil] robots any useful
-             // information via 404s.
-                response.body = '{}';
-            } else {
-                response.body = doc.body;
-            }
-            return response;
-        }
-    };
-
-    exports.updates = {
-     // NOTE: Do not out-clever yourself here! You _can_ add the CORS
-     // headers in this function, but if you're already doing it inside an
-     // external webserver like Nginx or Node.js, it will cause CORS _not_
-     // to work.
-        upsert: function (doc, req) {
-         // This function needs documentation.
-            var key, newDoc, response;
-            newDoc = JSON.parse(req.body);
-            response = {
-                headers: {
-                    'Content-Type': 'text/plain'
-                },
-                body: ''
-            };
-            if (doc === null) {
-             // We are inserting a new document.
-                return [newDoc, response];
-            }
-         // We are updating the existing document.
-            for (key in newDoc) {
-                if (newDoc.hasOwnProperty(key)) {
-                    doc[key] = newDoc[key];
-                }
-            }
-            return [doc, response];
-        }
-    };
-
-    exports.views = {
-        jobs: {
-            map: function (doc) {
-             // This function needs documentation.
-                var flag;
-                flag = ((doc.hasOwnProperty('box_status'))  &&
-                        (doc.hasOwnProperty('key')));
-                if (flag === true) {
-                    emit(doc.box_status.split('&'), doc.key);
-                }
-                return;
-            }
-        },
-        outdated: {
-            map: function (doc) {
-             // This function outputs a JSON array that I can modify slightly
-             // and POST back to Couch via the Bulk Documents API in order to
-             // delete all documents that are past their expiration dates.
-                if (doc.hasOwnProperty('exp_date')) {
-                    emit(doc.exp_date, {
-                        _id: doc._id,
-                        _rev: doc._rev,
-                        _deleted: true
-                    });
-                }
-                return;
-            }
-        }
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/couch-log-ddoc.js

-//- JavaScript source code
-
-//- couch-log-ddoc.js ~~
-//                                                      ~~ (c) SRW, 31 Mar 2013
-//                                                  ~~ last updated 20 May 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*global exports: false, getRow: false, send: false, sum: false */
-
-    /*jshint maxparams: 2, quotmark: single, strict: true */
-
-    /*jslint couch: true, indent: 4, maxlen: 80, nomen: true, unparam: true */
-
-    /*properties
-        'as-array', box_frequency, hasOwnProperty, _id, identity, ip,
-        ip_frequency, ips, lists, map, method, reduce, replace, shows, slice,
-        split, stringify, timestamp, updates, url, value, views
-    */
-
- // Out-of-scope definitions
-
-    exports._id = '_design/app';
-
-    exports.lists = {
-        'as-array': function () {
-         // This function can be useful for dumping the entire contents of the
-         // database for export into another database:
-         //
-         //     $ curl -o couch-dump.json \
-         //         localhost:5984/traffic/_design/app/_list/as-array/identity
-         //
-            var first, row;
-            first = true;
-            row = getRow();
-            send('[');
-            while (row !== null) {
-                if (first === true) {
-                    first = false;
-                    send(JSON.stringify(row.value));
-                } else {
-                    send(',' + JSON.stringify(row.value));
-                }
-                row = getRow();
-            }
-            send(']');
-            return;
-        }
-    };
-
-    exports.shows = {};
-
-    exports.updates = {};
-
-    exports.views = {
-
-        box_frequency: {
-            map: function (doc) {
-             // This function needs documentation.
-                var pattern;
-                if (doc.hasOwnProperty('url')) {
-                    pattern = /^\/box\/([\w\-]+)\?/;
-                    doc.url.replace(pattern, function (match, box) {
-                     // This function needs documentation.
-                        emit(box, 1);
-                        return;
-                    });
-                    return;
-                }
-                return;
-            },
-            reduce: function (keys, values) {
-             // This function needs documentation.
-                return sum(values);
-            }
-        },
-
-        identity: {
-            map: function (doc) {
-             // This function needs documentation.
-                if (doc._id.slice(0, 8) !== '_design/') {
-                    emit(null, {
-                        ip:         doc.ip,
-                        method:     doc.method,
-                        timestamp:  doc.timestamp,
-                        url:        doc.url
-                    });
-                }
-                return;
-            }
-        },
-
-        ip_frequency: {
-            map: function (doc) {
-             // This function needs documentation.
-                if (doc.hasOwnProperty('ip')) {
-                    emit(doc.ip.split(', ')[0], 1);
-                }
-                return;
-            },
-            reduce: function (keys, values) {
-             // This function needs documentation.
-                return sum(values);
-            }
-        }
-
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/defs-couch.js

-//- JavaScript source code
-
-//- defs-couch.js ~~
-//
-//  NOTE: I need to experiment with `require('https').globalAgent.maxSockets`!
-//
-//                                                      ~~ (c) SRW, 25 Sep 2012
-//                                                  ~~ last updated 20 May 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jshint maxparams: 3, quotmark: single, strict: true */
-
-    /*jslint indent: 4, maxlen: 80, node: true, nomen: true */
-
-    /*properties
-        api, avar_ttl, body, box_status, ceil, collect_garbage, 'Content-Type',
-        couch, create, end, error, exp_date, get_box_key, get_box_status,
-        headers, _id, isMaster, join, key, keys, length, log, method, now, on,
-        parse, post_box_key, protocol, push, request, _rev, statusCode,
-        stringify, toString, trim
-    */
-
- // Declarations
-
-    var cluster, create_db, http, https, stringify, upload_ddoc, url;
-
- // Definitions
-
-    cluster = require('cluster');
-
-    create_db = function (conn, callback) {
-     // This function needs documentation.
-        var options, protocol, req;
-        options = Object.create(conn);
-        options.method = 'PUT';
-        protocol = (conn.protocol === 'http:') ? http : https;
-        req = protocol.request(options, function (response) {
-         // This function needs documentation.
-            var temp = [];
-            response.on('data', function (chunk) {
-             // This function needs documentation.
-                temp.push(chunk.toString());
-                return;
-            });
-            response.on('end', function () {
-             // This function needs documentation.
-                return callback(null, temp.join(''));
-            });
-            return;
-        });
-        req.on('error', callback);
-        req.end();
-        return;
-    };
-
-    http = require('http');
-
-    https = require('https');
-
-    stringify = function (obj, keys) {
-     // This function only exists to serialize the design document cleanly. It
-     // doesn't demand the level of sophistication that the browser client's
-     // `serialize` method does because we know that this function will run in
-     // Node.js and that all functions will be serializable :-)
-        /*jslint unparam: true */
-        var i, n, temp;
-        temp = {};
-        n = keys.length;
-        for (i = 0; i < n; i += 1) {
-            temp[keys[i]] = obj[keys[i]];
-        }
-        return JSON.stringify(temp, function (key, val) {
-         // See the explanation above ;-)
-            if ((typeof val === 'function') && (val instanceof Function)) {
-                return val.toString();
-            }
-            return val;
-        });
-    };
-
-    upload_ddoc = function (file, app_url, callback) {
-     // This function needs documentation.
-        var opts, protocol, req;
-        opts = url.parse(app_url);
-        opts.method = 'GET';
-        protocol = (opts.protocol === 'http:') ? http : https;
-        req = protocol.request(opts, function (response) {
-         // This function needs documentation.
-            var temp = [];
-            response.on('data', function (chunk) {
-             // This function needs documentation.
-                temp.push(chunk.toString());
-                return;
-            });
-            response.on('end', function () {
-             // This function needs documentation.
-                var new_dd, $new_dd, old_dd, $old_dd, opts2, req2;
-                new_dd = require(file);
-                $old_dd = temp.join('');
-                if (response.statusCode === 200) {
-                    old_dd = JSON.parse($old_dd);
-                    new_dd = require(file);
-                    new_dd._id = old_dd._id;
-                    new_dd._rev = old_dd._rev;
-                    $new_dd = stringify(new_dd, Object.keys(old_dd));
-                    $old_dd = stringify(old_dd, Object.keys(old_dd));
-                    if ($new_dd === $old_dd) {
-                        return callback(null, 'Design document unchanged.');
-                    }
-                } else {
-                    $new_dd = stringify(new_dd, Object.keys(new_dd));
-                }
-                console.log('Uploading a new design document ...');
-                opts2 = Object.create(opts);
-                opts2.method = 'PUT';
-                req2 = protocol.request(opts2, function (response) {
-                 // This function needs documentation.
-                    var temp = [];
-                    response.on('data', function (chunk) {
-                     // This function needs documentation.
-                        temp.push(chunk.toString());
-                        return;
-                    });
-                    response.on('end', function () {
-                     // This function needs documentation.
-                        return callback(null, temp.join(''));
-                    });
-                    return;
-                });
-                req2.on('error', callback);
-                req2.end($new_dd);
-                return;
-            });
-            return;
-        });
-        req.on('error', callback);
-        req.end();
-        return;
-    };
-
-    url = require('url');
-
- // Out-of-scope definitions
-
-    exports.api = function (options) {
-     // This function needs documentation.
-
-        var app_url, collect_garbage, conn, exp_date, get_box_key,
-            get_box_status, protocol, post_box_key;
-
-        app_url = options.couch + '/_design/app/';
-
-        collect_garbage = function () {
-         // This function removes old documents from the "db" database, but it
-         // does not trigger compaction. The reason is simple -- automatic
-         // compaction is a standard feature of CouchDB 1.2 and later. To read
-         // more about configuring your couch, see http://goo.gl/V634R.
-            var callback, opts, req, target;
-            callback = function (err) {
-             // This function needs documentation.
-                if (err !== null) {
-                    console.error('Error:', err);
-                    return;
-                }
-                console.log('Finished collecting garbage.');
-                return;
-            };
-            target = app_url + '_list/as-array/outdated?startkey=0&endkey=' +
-                    Math.ceil(Date.now() / 1000);
-            opts = url.parse(target);
-            opts.method = 'GET';
-            req = protocol.request(opts, function (res) {
-             // This function needs documentation.
-                var temp = [];
-                res.on('data', function (chunk) {
-                 // This function needs documentation.
-                    temp.push(chunk.toString());
-                    return;
-                });
-                res.on('end', function () {
-                 // This function needs documentation.
-                    var body, opts2, req2;
-                    body = temp.join('');
-                    if (body === '[]') {
-                        return callback(null);
-                    }
-                    opts2 = url.parse(options.couch + '/_bulk_docs');
-                    opts2.headers = {'Content-Type': 'application/json'};
-                    opts2.method = 'POST';
-                    req2 = protocol.request(opts2, function () {
-                     // This function omits named parameters because it omits
-                     // them anyway.
-                        return callback(null);
-                    });
-                    req2.on('error', callback);
-                    req2.end('{"docs":' + body + '}');
-                    return;
-                });
-                return;
-            });
-            req.on('error', callback);
-            req.end();
-            return;
-        };
-
-        conn = url.parse(options.couch);
-
-        exp_date = function () {
-         // This function needs documentation.
-            return Math.ceil((Date.now() / 1000) + options.avar_ttl);
-        };
-
-        get_box_key = function (params, callback) {
-         // This function needs documentation.
-            var opts, req, target;
-            target = app_url + '_show/data/' + params[0] + '&' + params[1];
-            opts = url.parse(target);
-            opts.method = 'GET';
-            req = protocol.request(opts, function (res) {
-             // This function needs documentation.
-                var temp = [];
-                res.on('data', function (chunk) {
-                 // This function needs documentation.
-                    temp.push(chunk.toString());
-                    return;
-                });
-                res.on('end', function () {
-                 // This function needs documentation.
-                    return callback(null, temp.join(''));
-                });
-                return;
-            });
-            req.on('error', callback);
-            req.end();
-            return;
-        };
-
-        get_box_status = function (params, callback) {
-         // This function needs documentation.
-            var opts, req, target;
-            target = app_url + '_list/as-array/jobs?key=["' +  params[0] +
-                    '","' + params[1] + '"]';
-            opts = url.parse(target);
-            opts.method = 'GET';
-            req = protocol.request(opts, function (res) {
-             // This function needs documentation.
-                var temp = [];
-                res.on('data', function (chunk) {
-                 // This function needs documentation.
-                    temp.push(chunk.toString());
-                    return;
-                });
-                res.on('end', function () {
-                 // This function needs documentation.
-                    return callback(null, JSON.parse(temp.join('')));
-                });
-                return;
-            });
-            req.on('error', callback);
-            req.end();
-            return;
-        };
-
-        protocol = (conn.protocol === 'http:') ? http : https;
-
-        post_box_key = function (params, callback) {
-         // This function needs documentation.
-            var obj, opts, req;
-            if (params.length === 4) {
-                obj = {
-                    _id:        params[0] + '&' + params[1],
-                    body:       params[3],
-                    box_status: params[0] + '&' + params[2],
-                    exp_date:   exp_date(),
-                    key:        params[1]
-                };
-            } else {
-                obj = {
-                    _id:        params[0] + '&' + params[1],
-                    body:       params[2],
-                    exp_date:   exp_date(),
-                    key:        params[1]
-                };
-            }
-            opts = url.parse(app_url + '_update/upsert/' + obj._id);
-            opts.headers = {'Content-Type': 'application/json'};
-            opts.method = 'POST';
-            req = protocol.request(opts, function (res) {
-             // This function needs documentation.
-                res.on('data', function () {
-                 // This function is empty, but it is necessary due to changes
-                 // in the way that the streaming API works in Node.js, as of
-                 // version 0.10 and later.
-                    return;
-                });
-                res.on('end', function () {
-                 // This function needs documentation.
-                    if ((res.statusCode !== 201) && (res.statusCode !== 202)) {
-                     // Ordinarily, we want a 201, but batch mode returns an
-                     // "HTTP 202: Accepted" response, and Cloudant's BigCouch
-                     // seems to use batch mode sometimes. All other status
-                     // codes indicate an error.
-                        return callback(res.statusCode);
-                    }
-                    return callback(null);
-                });
-                return;
-            });
-            req.on('error', callback);
-            req.end(JSON.stringify(obj));
-            return;
-        };
-
-        if (cluster.isMaster) {
-            create_db(conn, function (err, response) {
-             // This function needs documentation.
-                if (err !== null) {
-                    console.error('Error:', err);
-                }
-                upload_ddoc('./couch-api-ddoc', app_url, function (err) {
-                 // This function also accepts a second argument that contains
-                 // the "results" of the query, but because I don't use it, I
-                 // have omitted it to avoid irritating JSLint et al.
-                    if (err !== null) {
-                        console.error('Error:', err);
-                    }
-                    console.log(response.trim());
-                    console.log('API: CouchDB storage is ready.');
-                    return;
-                });
-                return;
-            });
-        }
-        return {
-            collect_garbage: collect_garbage,
-            get_box_key: get_box_key,
-            get_box_status: get_box_status,
-            post_box_key: post_box_key
-        };
-    };
-
-    exports.log = function (options) {
-     // This function needs documentation.
-        var app_url, conn, protocol;
-        app_url = options.couch + '/_design/app/';
-        conn = url.parse(options.couch);
-        protocol = (conn.protocol === 'http:') ? http : https;
-        if (cluster.isMaster) {
-            create_db(conn, function (err, response) {
-             // This function needs documentation.
-                if (err !== null) {
-                    console.error('Error:', err);
-                }
-                upload_ddoc('./couch-log-ddoc', app_url, function (err) {
-                 // This function also accepts a second argument that contains
-                 // the "results" of the query, but because I don't use it, I
-                 // have omitted it to avoid irritating JSLint et al.
-                    if (err !== null) {
-                        console.error('Error:', err);
-                    }
-                    console.log(response.trim());
-                    console.log('LOG: CouchDB storage is ready.');
-                    return;
-                });
-                return;
-            });
-        }
-        return function (obj) {
-         // This function needs documentation.
-            var req;
-            conn.headers = {'Content-Type': 'application/json'};
-            conn.method = 'POST';
-            req = protocol.request(conn, function (res) {
-             // This function needs documentation.
-                res.on('data', function () {
-                 // This function is empty, but it is necessary due to changes
-                 // in the way that the streaming API works in Node.js, as of
-                 // version 0.10 and later.
-                    return;
-                });
-                res.on('end', function () {
-                 // See the explanation given above.
-                    return;
-                });
-                return;
-            });
-            req.on('error', function (message) {
-             // This function needs documentation.
-                console.error('Error:', message);
-                return;
-            });
-            req.end(JSON.stringify(obj));
-            return;
-        };
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/defs-mongo.js

-//- JavaScript source code
-
-//- defs-mongo.js ~~
-//
-//  These definitions are getting a lot more attention now :-)
-//
-//                                                      ~~ (c) SRW, 05 Nov 2012
-//                                                  ~~ last updated 22 Jun 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jshint maxparams: 2, quotmark: single, strict: true */
-
-    /*jslint indent: 4, maxlen: 80, node: true, nomen: true */
-
-    /*properties
-        _id, api, avar_ttl, body, box_status, collect_garbage, collection,
-        connect, ensureIndex, error, exp_date, expireAfterSeconds, find,
-        findOne, get_box_key, get_box_status, isWorker, key, length, log,
-        mongo, MongoClient, on, post_box_key, push, safe, save, stream, update,
-        upsert
-    */
-
- // Declarations
-
-    var cluster, mongo;
-
- // Definitions
-
-    cluster = require('cluster');
-
-    mongo = require('mongodb').MongoClient;
-
- // Out-of-scope definitions
-
-    exports.api = function (options) {
-     // This function needs documentation, but as far as connection pooling is
-     // concerned, my strategy is justified by the post on Stack Overflow at
-     // http://stackoverflow.com/a/14464750.
-
-        var collect_garbage, db, get_box_key, get_box_status, post_box_key;
-
-        collect_garbage = function () {
-         // This function isn't even needed anymore, because these definitions
-         // are now taking advantage of TTL collections :-)
-            console.log('(fake garbage collection)');
-            return;
-        };
-
-        get_box_key = function (params, callback) {
-         // This function needs documentation.
-            var pattern = {_id: params[0] + '&' + params[1]};
-            db.collection('avars').findOne(pattern, function (err, item) {
-             // This function needs documentation.
-                if (err !== null) {
-                    return callback(err, undefined);
-                }
-                return callback(null, (item === null) ? undefined : item.body);
-            });
-            return;
-        };
-
-        get_box_status = function (params, callback) {
-         // This function needs documentation.
-            var items, pattern, stream;
-            items = [];
-            pattern = {box_status: params[0] + '&' + params[1]};
-            stream = db.collection('avars').find(pattern).stream();
-            stream.on('close', function () {
-             // This function needs documentation.
-                return callback(null, items);
-            });
-            stream.on('data', function (item) {
-             // This function needs documentation.
-                items.push(item.key);
-                return;
-            });
-            stream.on('error', callback);
-            return;
-        };
-
-        post_box_key = function (params, callback) {
-         // This function needs documentation.
-            var obj, options, spec;
-            if (params.length === 4) {
-                obj = {
-                    _id:        params[0] + '&' + params[1],
-                    body:       params[3],
-                    box_status: params[0] + '&' + params[2],
-                    exp_date:   new Date(),
-                    key:        params[1]
-                };
-            } else {
-                obj = {
-                    _id:        params[0] + '&' + params[1],
-                    body:       params[2],
-                    exp_date:   new Date(),
-                    key:        params[1]
-                };
-            }
-            options = {safe: true, upsert: true};
-            spec = {_id: params[0] + '&' + params[1]};
-            db.collection('avars').update(spec, obj, options, callback);
-            return;
-        };
-
-        mongo.connect(options.mongo, function (err, db_handle) {
-         // This function is a LOT simpler than what I had before!
-            if (err !== null) {
-                throw err;
-            }
-            db = db_handle;
-            if (cluster.isWorker) {
-                return;
-            }
-            db.collection('avars').ensureIndex('exp_date', {
-                expireAfterSeconds: options.avar_ttl
-            }, function (err) {
-             // This function needs documentation.
-                if (err !== null) {
-                    throw err;
-                }
-                console.log('API: MongoDB storage is ready.');
-                return;
-            });
-            return;
-        });
-
-        return {
-            collect_garbage: collect_garbage,
-            get_box_key: get_box_key,
-            get_box_status: get_box_status,
-            post_box_key: post_box_key
-        };
-    };
-
-    exports.log = function (options) {
-     // This function needs documentation.
-        var db;
-        mongo.connect(options.mongo, function (err, db_handle) {
-         // This function needs documentation.
-            if (err !== null) {
-                throw err;
-            }
-            db = db_handle;
-            return;
-        });
-        return function (obj) {
-         // This function needs documentation.
-            db.collection('traffic').save(obj, function (err) {
-             // This function needs documentation.
-                if (err !== null) {
-                    console.error('Error:', err);
-                }
-                return;
-            });
-            return;
-        };
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/defs-postgres.js

-//- JavaScript source code
-
-//- defs-postgres.js ~~
-//
-//  NOTE: SQL is _not_ a particular strength of mine, and I appreciate input!
-//
-//                                                      ~~ (c) SRW, 25 Sep 2012
-//                                                  ~~ last updated 20 May 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jshint maxparams: 3, quotmark: single, strict: true */
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
- // Declarations
-
-    var cluster, pg;
-
- // Definitions
-
-    cluster = require('cluster');
-
-    pg = require('pg');                 //- or, use `require('pg').native` ...
-
- // Out-of-scope definitions
-
-    module.exports = function (options) {
-     // This function needs documentation.
-
-        var collect_garbage, connection_string, exp_date, get_box_key,
-            get_box_status, post_box_key;
-
-        collect_garbage = function () {
-         // This function needs documentation.
-            pg.connect(connection_string, function (err, client, done) {
-             // This function needs documentation.
-                if (err !== null) {
-                    console.error('Error:', err);
-                    done();
-                    return;
-                }
-                var now, sql;
-                now = Math.ceil(Date.now() / 1000);
-                sql = 'DELETE FROM avars WHERE (exp_date < $1)';
-                client.query(sql, [now], function (err) {
-                 // This function n needs documentation.
-                    if (err !== null) {
-                        console.error('Error:', err);
-                    } else {
-                        console.log('Finished collecting garbage.');
-                    }
-                    done();
-                    return;
-                });
-                return;
-            });
-            return;
-        };
-
-        connection_string = options.postgres;
-
-        exp_date = function () {
-         // This function needs documentation.
-            return Math.ceil((Date.now() / 1000) + options.avar_ttl);
-        };
-
-        get_box_key = function (params, callback) {
-         // This function needs documentation.
-            pg.connect(connection_string, function (err, client, done) {
-             // This function needs documentation.
-                if (err !== null) {
-                    done();
-                    return callback(err, undefined);
-                }
-                var x = 'SELECT body FROM avars WHERE box_key = $1';
-                client.query(x, [params.join('&')], function (err, results) {
-                 // This function needs documentation.
-                    done();
-                    if (err !== null) {
-                        return callback(err, undefined);
-                    }
-                    if (results.rows.length < 1) {
-                        return callback(null, undefined);
-                    }
-                    return callback(null, results.rows[0].body);
-                });
-                return;
-            });
-            return;
-        };
-
-        get_box_status = function (params, callback) {
-         // This function needs documentation.
-            pg.connect(connection_string, function (err, client, done) {
-             // This function needs documentation.
-                if (err !== null) {
-                    done();
-                    return callback(err, undefined);
-                }
-                var x = 'SELECT key FROM avars WHERE box_status = $1';
-                client.query(x, [params.join('&')], function (err, results) {
-                 // This function needs documentation.
-                    done();
-                    if (err !== null) {
-                        return callback(err, undefined);
-                    }
-                    var y = (results === undefined) ? {rows: []} : results;
-                    return callback(null, y.rows.map(function (row) {
-                     // This function needs documentation.
-                        return row.key;
-                    }));
-                });
-                return;
-            });
-            return;
-        };
-
-        post_box_key = function (params, callback) {
-         // This function needs documentation.
-            pg.connect(connection_string, function (err, client, done) {
-             // This function needs documentation.
-                if (err !== null) {
-                    done();
-                    return callback(err, undefined);
-                }
-                var args, sql;
-                if (params.length === 4) {
-                    args = [
-                        params[3],
-                        params[0] + '&' + params[1],
-                        params[0] + '&' + params[2],
-                        exp_date(),
-                        params[1]
-                    ];
-                    sql = 'SELECT upsert_task($1, $2, $3, $4, $5)';
-                } else {
-                    args = [
-                        params[2],
-                        params[0] + '&' + params[1],
-                        exp_date()
-                    ];
-                    sql = 'SELECT upsert_avar($1, $2, $3)';
-                }
-                client.query(sql, args, function (err, results) {
-                 // This function needs documentation.
-                    done();
-                    return callback(err, results);
-                });
-                return;
-            });
-            return;
-        };
-
-        if (cluster.isMaster) {
-            pg.connect(connection_string, function (err, client, done) {
-             // This function needs documentation.
-                if (err !== null) {
-                    done();
-                    throw err;
-                }
-                var lines;
-                lines = [
-                    'CREATE TABLE IF NOT EXISTS avars (',
-                    '   body TEXT NOT NULL,',
-                    '   box_key TEXT NOT NULL,',
-                    '   box_status TEXT,',
-                    '   exp_date INTEGER NOT NULL,',
-                    '   key TEXT,',     //- this doesn't need to be "NOT NULL"
-                    '   PRIMARY KEY (box_key)',
-                    ');',
-                    'CREATE OR REPLACE FUNCTION upsert_avar' +
-                        '(b2 TEXT, bk2 TEXT, ed2 INTEGER) RETURNS VOID AS',
-                    '$$',
-                    'BEGIN',
-                    '   LOOP',
-                    '       UPDATE avars',
-                    '           SET body = b2,' +
-                        '           box_status = NULL,' +
-                        '           exp_date = ed2,' +
-                        '           key = NULL',
-                    '           WHERE box_key = bk2;',
-                    '       IF found THEN',
-                    '           RETURN;',
-                    '       END IF;',
-                    '       BEGIN',
-                    '           INSERT INTO avars (body, box_key, exp_date)',
-                    '               VALUES (b2, bk2, ed2);',
-                    '           RETURN;',
-                    '       EXCEPTION WHEN unique_violation THEN',
-                    '       END;',
-                    '   END LOOP;',
-                    'END;',
-                    '$$',
-                    'LANGUAGE plpgsql;',
-                    'CREATE OR REPLACE FUNCTION upsert_task' +
-                        '(b2 TEXT, bk2 TEXT, bs2 TEXT, ed2 INTEGER, k2 TEXT)' +
-                        'RETURNS VOID AS',
-                    '$$',
-                    'BEGIN',
-                    '   LOOP',
-                    '       UPDATE avars',
-                    '           SET body = b2,' +
-                        '           box_status = bs2,' +
-                        '           exp_date = ed2,' +
-                        '           key = k2',
-                    '           WHERE box_key = bk2;',
-                    '       IF found THEN',
-                    '           RETURN;',
-                    '       END IF;',
-                    '       BEGIN',
-                    '           INSERT INTO avars ' +
-                        '           (body, box_key, box_status, exp_date, key)',
-                    '               VALUES (b2, bk2, bs2, ed2, k2);',
-                    '           RETURN;',
-                    '       EXCEPTION WHEN unique_violation THEN',
-                    '       END;',
-                    '   END LOOP;',
-                    'END;',
-                    '$$',
-                    'LANGUAGE plpgsql;'
-                ];
-                client.query(lines.join('\n'), function (err) {
-                 // This function also accepts a second argument that contains
-                 // the "results" of the query, but because I don't use it, I
-                 // have omitted it to avoid irritating JSLint et al.
-                    done();
-                    if (err !== null) {
-                        throw err;
-                    }
-                    console.log('API: Postgres storage is ready.');
-                    return;
-                });
-                return;
-            });
-        }
-
-        return {
-            collect_garbage: collect_garbage,
-            get_box_key: get_box_key,
-            get_box_status: get_box_status,
-            post_box_key: post_box_key
-        };
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/defs-redis.js

-//- JavaScript source code
-
-//- defs-redis.js ~~
-//
-//  The first step here was just to get things running with plain old arrays in
-//  JavaScript, and I accomplished that. The next step is to jettison anything
-//  that hinders performance, since it's downright sinful to choose a platform
-//  like Node.js + Redis and then squander cycles needlessly ...
-//
-//                                                      ~~ (c) SRW, 23 Nov 2012
-//                                                  ~~ last updated 20 May 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jshint maxparams: 2, quotmark: single, strict: true */
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
- // Declarations
-
-    var cluster, redis, url;
-
- // Definitions
-
-    cluster = require('cluster');
-
-    redis = require('redis');
-
-    url = require('url');
-
- // Out-of-scope definitions
-
-    module.exports = function (options) {
-     // This function needs documentation.
-        var collect_garbage, conn, db, exp_date, get_box_key, get_box_status,
-            post_box_key;
-
-        collect_garbage = function () {
-         // This function needs documentation.
-            var remaining, seek_and_destroy;
-            seek_and_destroy = function (queue) {
-             // This function needs documentation.
-                var box = queue.replace(/^\$\:([\w\-]+)[&][\w\-]+/, '$1');
-                db.smembers(queue, function (err, response) {
-                 // This function needs documentation.
-                    if (err !== null) {
-                        console.error('Error:', err);
-                        return;
-                    }
-                    var callback, n;
-                    callback = function () {
-                     // This function needs documentation.
-                        n -= 1;
-                        if (n === 0) {
-                            remaining -= 1;
-                            if (remaining === 0) {
-                                console.log('Finished collecting garbage.');
-                            }
-                        }
-                        return;
-                    };
-                    n = response.length;
-                    response.forEach(function (key) {
-                     // This function needs documentation.
-                        db.exists(box + '&' + key, function (err, response) {
-                         // This function needs documentation.
-                            if (err !== null) {
-                                console.error('Error:', err);
-                            }
-                            if (response === 0) {
-                                db.srem(queue, key, function (err) {
-                                 // This function accepts a second argument,
-                                 // but I have omitted it because it irritates
-                                 // JSLint et al. otherwise.
-                                    if (err !== null) {
-                                        console.error('Error:', err);
-                                    }
-                                    return callback();
-                                });
-                            } else {
-                                callback();
-                            }
-                            return;
-                        });
-                        return;
-                    });
-                    if (n === 0) {
-                        callback();
-                    }
-                    return;
-                });
-                return;
-            };
-            db.keys('$:*', function (err, queues) {
-             // This function needs documentation.
-                if (err !== null) {
-                    console.error('Error:', err);
-                    return;
-                }
-                remaining = queues.length;
-                queues.forEach(seek_and_destroy);
-                if (remaining === 0) {
-                    console.log('Finished collecting garbage.');
-                }
-                return;
-            });
-            return;
-        };
-
-        conn = url.parse(options.redis);
-
-        db = redis.createClient(conn.port, conn.hostname, {
-         // For more information, see http://git.io/PRZ7Bw .
-            detect_buffers: false,
-            enable_offline_queue: true,
-            no_ready_check: true,
-            parser: 'hiredis',
-            return_buffers: false,
-            socket_nodelay: true
-        });
-
-        exp_date = function () {
-         // This function needs documentation.
-            return Math.ceil(options.avar_ttl);
-        };
-
-        get_box_key = function (params, callback) {
-         // This function needs documentation.
-            db.hget(params[0] + '&' + params[1], 'body', callback);
-            return;
-        };
-
-        get_box_status = function (params, callback) {
-         // This function needs documentation.
-            db.smembers('$:' + params[0] + '&' + params[1], callback);
-            return;
-        };
-
-        post_box_key = function (params, callback) {
-         // This function needs documentation.
-            var body, box, key, status;
-            if (params.length === 4) {
-                body = params[3];
-                status = params[2];
-            } else {
-                body = params[2];
-            }
-            box = params[0];
-            key = params[1];
-            db.hget(box + '&' + key, 'status', function (err, res) {
-             // This function needs documentation.
-                if (err !== null) {
-                    return callback(err, res);
-                }
-                var multi, set1, set2, updated;
-                multi = db.multi();
-                updated = {body: body};
-                if (res !== null) {
-                    set1 = '$:' + box + '&' + res;
-                    multi.srem(set1, key);
-                }
-                if (status !== undefined) {
-                    updated.status = status;
-                    set2 = '$:' + box + '&' + updated.status;
-                    multi.sadd(set2, key);
-                }
-                multi.hmset(box + '&' + key, updated);
-                multi.expire(box + '&' + key, exp_date());
-                multi.exec(callback);
-                return;
-            });
-            return;
-        };
-
-        db.auth(conn.auth.split(':')[1]);
-
-        db.on('connect', function () {
-         // This function needs documentation.
-            if (cluster.isMaster) {
-                console.log('API: Redis storage is ready.');
-            }
-            return;
-        });
-
-        db.on('end', function () {
-         // This function needs documentation.
-            console.log('(Redis client closed)');
-            return;
-        });
-
-        db.on('error', function (message) {
-         // This function needs documentation.
-            console.error('Error:', message);
-            return;
-        });
-
-        process.on('exit', function () {
-         // This function needs documentation.
-            db.quit();
-            console.log('(Redis client released)');
-            return;
-        });
-
-        return {
-            collect_garbage: collect_garbage,
-            get_box_key: get_box_key,
-            get_box_status: get_box_status,
-            post_box_key: post_box_key
-        };
-    };
-
- // That's all, folks!
-
-    return;
-
-}());
-
-//- vim:set syntax=javascript:

File src/npm-package/lib/defs-sqlite.js

-//- JavaScript source code
-
-//- defs-sqlite.js ~~
-//
-//  NOTE: SQL is _not_ a particular strength of mine, and I appreciate input!
-//
-//                                                      ~~ (c) SRW, 25 Sep 2012
-//                                                  ~~ last updated 25 Apr 2013
-
-(function () {
-    'use strict';
-
- // Pragmas
-
-    /*jshint maxparams: 2, quotmark: single, strict: true */
-
-    /*jslint indent: 4, maxlen: 80, node: true */
-
- // Declarations
-
-    var cluster, sqlite;
-
- // Definitions
-
-    cluster = require('cluster');
-
-    sqlite = require('sqlite3');
-
- // Out-of-scope definitions
-
-    module.exports = function (options) {
-     // This function needs documentation.
-
-        var collect_garbage, db, exp_date, get_box_key, get_box_status,
-            post_box_key;
-
-        collect_garbage = function () {
-         // This function needs documentation.
-            var lines, values;
-            lines = 'DELETE FROM avars WHERE (exp_date < $now)';
-            values = {
-                $now: Math.ceil(Date.now() / 1000)
-            };
-            db.run(lines, values, function (err) {
-             // This function needs documentation.
-                if (err !== null) {
-                    console.error('Error:', err);
-                    return;
-                }
-                console.log('Finished collecting garbage.');
-                return;
-            });
-            return;
-        };
-
-        db = new sqlite.cached.Database(options.sqlite, function (err) {
-         // This function needs documentation.
-            if (err !== null) {
-                throw err;
-            }
-            if (cluster.isWorker) {
-                return;
-            }
-            var lines;
-            lines = [
-                'CREATE TABLE IF NOT EXISTS avars (',
-                '   body TEXT NOT NULL,',
-                '   box_key TEXT NOT NULL,',
-                '   box_status TEXT,',
-                '   exp_date INTEGER NOT NULL,',
-                '   key TEXT,',         //- this doesn't need to be "NOT NULL"
-                '   PRIMARY KEY (box_key)',
-                ')'
-            ];
-            db.run(lines.join('\n'), function (err) {
-             // This function needs documentation.
-                if (err !== null) {
-                    throw err;
-                }
-                console.log('API: SQLite storage is ready.');
-                return;
-            });
-            return;
-        });
-
-        exp_date = function () {
-         // This function needs documentation.
-            return Math.ceil((Date.now() / 1000) + options.avar_ttl);
-        };
-
-        get_box_key = function (params, callback) {
-         // This function needs documentation.
-            var box_key, sql;
-            box_key = params[0] + '&' + params[1];
-            sql = 'SELECT body FROM avars WHERE box_key = $box_key';
-            db.get(sql, {$box_key: box_key}, function (err, row) {
-             // This function needs documentation.
-                if (err !== null) {
-                    if (err.errno === 5) {
-                        process.nextTick(function () {
-                         // This function needs documentation.
-                            return get_box_key(params, callback);
-                        });
-                        return;
-                    }
-                    return callback(err, row);
-                }
-                return callback(null, (row === undefined) ? row : row.body);
-            });
-            return;
-        };
-
-        get_box_status = function (params, callback) {
-         // This function needs documentation.
-            var box_status, sql;
-            box_status = params[0] + '&' + params[1];
-            sql = 'SELECT key FROM avars WHERE box_status = $box_status';
-            db.all(sql, {$box_status: box_status}, function (err, rows) {
-             // This function needs documentation.
-                if (err !== null) {
-                    if (err.errno === 5) {
-                        process.nextTick(function () {
-                         // This function needs documentation.
-                            return get_box_status(params, callback);
-                        });
-                        return;
-                    }
-                    return callback(err, rows);
-                }
-                if (rows === undefined) {
-                    return callback(null, rows);
-                }
-                return callback(null, rows.map(function (row) {
-                 // This function needs documentation.
-                    return row.key;
-                }));
-            });
-            return;
-        };
-
-        post_box_key = function (params, callback) {
-         // This function needs documentation.
-            var lines, values;
-            if (params.length === 4) {
-                lines = [
-                    'INSERT OR REPLACE INTO avars ' +
-                            '(body, box_key, box_status, exp_date, key)',
-                    '   VALUES ($body, ' +
-                            '   $box_key,' +
-                            '   $box_status,' +
-                            '   $exp_date,' +
-                            '   $key)'
-                ];
-                values = {
-                    $body:          params[3],
-                    $box_key:       params[0] + '&' + params[1],
-                    $box_status:    params[0] + '&' + params[2],
-                    $exp_date:      exp_date(),
-                    $key:           params[1]
-                };
-            } else {
-                lines = [
-                    'INSERT OR REPLACE INTO avars ' +
-                            '(body, box_key, exp_date)',
-                    '   VALUES ($body, $box_key, $exp_date)'
-                ];
-                values = {
-                    $body:          params[2],
-                    $box_key:       params[0] + '&' + params[1],
-                    $exp_date:      exp_date()
-                };
-            }
-            db.run(lines.join('\n'), values, function (err) {
-             // This function needs documentation.
-                if (err !== null) {
-                    if (err.errno === 5) {
-                        process.nextTick(function () {
-                         // This function needs documentation.
-                            return post_box_key(params, callback);