Commits

Sean Wilkinson  committed 3af0037

Bumped version to 1.1.5

  • Participants
  • Parent commits 4449e6d
  • Tags v1.1.5

Comments (0)

Files changed (9)

 #   Thanks for stopping by :-)
 #
 #                                                       ~~ (c) SRW, 06 Feb 2012
-#                                                   ~~ last updated 02 Dec 2013
+#                                                   ~~ last updated 09 Dec 2013
 
 PROJ_ROOT   :=  $(realpath $(dir $(firstword $(MAKEFILE_LIST))))
 
 web-service:                                                                \
     $(addprefix $(BUILD_DIR)/web-service/,                                  \
         .gitignore                                                          \
+        custom.js                                                           \
         katamari.json                                                       \
         package.json                                                        \
         Procfile                                                            \

File src/bower-package/bower.json

         "./src/browser-client/style.css"
     ],
     "name": "qm",
-    "version": "1.1.4"
+    "version": "1.1.5"
 }

File src/browser-client/manifest.webapp

     "name": "QMachine",
     "permissions": {},
     "type": "web",
-    "version": "1.1.4"
+    "version": "1.1.5"
 }

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

         "unlimitedStorage"
     ],
     "short_name": "QMachine",
-    "version": "1.1.4"
+    "version": "1.1.5"
 }

Submodule src/npm-module

-Subproject commit 02a7b81a3e122746327f5c36ddff402ce1f32f75
+Subproject commit ea0f83b9176c4523bce11139a4840db92751a0e0

Submodule src/ruby-gem

-Subproject commit 8bfc21a2c08c32169e57c21976667b2ac6d1a6f5
+Subproject commit a9b465cdbb32a5cbcc7f7099ee9e3a6883997350

File src/web-service/custom.js

+//- JavaScript source code
+
+//- custom.js ~~
+//                                                      ~~ (c) SRW, 09 Dec 2013
+//                                                  ~~ last updated 09 Dec 2013
+
+(function () {
+    'use strict';
+
+ // Pragmas
+
+    /*jslint indent: 4, maxlen: 80, node: true */
+
+ // Module definitions
+
+    exports.log = function (request) {
+     // This is a custom logging function that executes once for every request
+     // if logging is enabled. This function is optional, however, because
+     // QMachine provides a default logging function; feel free to delete or
+     // adapt it as needed :-)
+        var data = {
+            host: request.headers.host,
+            method: request.method,
+            timestamp: new Date(),
+            url: request.url
+        };
+        if (request.headers.hasOwnProperty('cf-ipcountry')) {
+         // This header is specific to CloudFlare (www.cloudflare.com), but
+         // storing the header with a hyphen inside can cause problems in query
+         // languages like Hive. Thus, we use a hyphen convention.
+            data.cf_ipcountry = request.headers['cf-ipcountry'];
+        }
+        if (request.headers.hasOwnProperty('x-forwarded-for')) {
+            data.ip = request.headers['x-forwarded-for'].split(',')[0];
+        } else {
+            data.ip = request.connection.remoteAddress;
+        }
+        return data;
+    };
+
+    exports.parse = function (x) {
+     // This function needs documentation.
+        return JSON.parse(x, function (key, val) {
+         // This function needs documentation.
+            /*jslint unparam: true */
+            if (typeof val === 'string') {
+                return val.replace(/[$][{]([A-Z0-9_]+)[}]/g, function ($0, $1) {
+                 // This function needs documentation.
+                    return process.env[$1];
+                });
+            }
+            return val;
+        });
+    };
+
+ // That's all, folks!
+
+    return;
+
+}());
+
+//- vim:set syntax=javascript:

File src/web-service/package.json

         "email": "sean@mathbiol.org"
     },
     "dependencies": {
-        "qm": "1.1.4"
+        "qm": "1.1.5"
     },
     "engines": {
         "node": ">= 0.8.0",
     "readme": "See https://wiki.qmachine.org for more information.",
     "repository": [],
     "scripts": {},
-    "version": "1.1.4"
+    "version": "1.1.5"
 }

File src/web-service/server.js

 
 //- server.js ~~
 //                                                      ~~ (c) SRW, 06 Oct 2012
-//                                                  ~~ last updated 26 Nov 2013
+//                                                  ~~ last updated 09 Dec 2013
 
 (function () {
     'use strict';
  // Definitions
 
     options = {
+        log: require('./custom').log,
         worker_procs: require('os').cpus().length
     };
 
-    parse = function (x) {
-     // This function needs documentation.
-        return JSON.parse(x, function (key, val) {
-         // This function needs documentation.
-            /*jslint unparam: true */
-            if (typeof val === 'string') {
-                return val.replace(/[$][{]([A-Z0-9_]+)[}]/g, function ($0, $1) {
-                 // This function needs documentation.
-                    return process.env[$1];
-                });
-            }
-            return val;
-        });
-    };
+    parse = require('./custom').parse;
 
     qm = require('qm');