From 872fda31baa8c83481d750a5d9e2ad4b225376ec Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Fri, 9 Jan 2015 13:48:24 +0100 Subject: [PATCH 1/4] formatting and code style fixes --- lib/date_formatter.js | 2 +- test/client_test.js | 2 +- test/date_formatter.js | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/date_formatter.js b/lib/date_formatter.js index a11d00f..bf0d3d6 100644 --- a/lib/date_formatter.js +++ b/lib/date_formatter.js @@ -52,7 +52,7 @@ DateFormatter.ISO8601 = new RegExp( DateFormatter.prototype.setOpts = function (opts) { if (!opts) opts = DateFormatter.DEFAULT_OPTIONS - var ctx = this; + var ctx = this Object.keys(DateFormatter.DEFAULT_OPTIONS).forEach(function (k) { ctx.opts[k] = opts.hasOwnProperty(k) ? opts[k] : DateFormatter.DEFAULT_OPTIONS[k] diff --git a/test/client_test.js b/test/client_test.js index 06bdebe..b773eee 100644 --- a/test/client_test.js +++ b/test/client_test.js @@ -5,7 +5,7 @@ var vows = require('vows') , fs = require('fs') const VALID_RESPONSE = fs.readFileSync(__dirname + '/fixtures/good_food/string_response.xml') -const BROKEN_XML= fs.readFileSync(__dirname + '/fixtures/bad_food/broken_xml.xml') +const BROKEN_XML = fs.readFileSync(__dirname + '/fixtures/bad_food/broken_xml.xml') vows.describe('Client').addBatch({ ////////////////////////////////////////////////////////////////////// diff --git a/test/date_formatter.js b/test/date_formatter.js index 7613085..33e4818 100644 --- a/test/date_formatter.js +++ b/test/date_formatter.js @@ -37,7 +37,7 @@ vows.describe('Date Formatter').addBatch({ assert.isString(str) assert.match(str, new RegExp()) } - , teardown: function () { date_formatter.setOpts(); } + , teardown: function () { date_formatter.setOpts() } } , "to utc representation": { topic: function (d) { @@ -65,7 +65,7 @@ vows.describe('Date Formatter').addBatch({ assert.isString(str) assert.match(str, new RegExp(reStr)) } - , teardown: function () { date_formatter.setOpts(); } + , teardown: function () { date_formatter.setOpts() } } } } @@ -118,6 +118,7 @@ vows.describe('Date Formatter').addBatch({ } }).export(module) +// HELPERS function encodeCase (opts, reStr) { return { topic: function (d) { @@ -129,7 +130,7 @@ function encodeCase (opts, reStr) { assert.isString(str) assert.match(str, new RegExp(reStr)) } - , teardown: function () { date_formatter.setOpts(); } + , teardown: function () { date_formatter.setOpts() } } } From 60c57e54fe45d73d5893d856aaa45b62024ff655 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Fri, 9 Jan 2015 13:55:56 +0100 Subject: [PATCH 2/4] minor README formatting fixes --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3e3c1d1..07328d0 100644 --- a/README.md +++ b/README.md @@ -119,17 +119,24 @@ xmlrpc.dateFormatter.setOpts({ ### Cookies support -It is possible to turn on cookies support for XML-RPC client by special options flag. -If turned on then all the cookies received from server will be bounced back with subsequent calls to the server. -You also may manipulate cookies manually by the setCookie/getCookie call. +It is possible to turn on cookies support for XML-RPC client by special options +flag. If turned on then all the cookies received from server will be bounced +back with subsequent calls to the server. You also may manipulate cookies +manually by the setCookie/getCookie call. ```javascript -var client = xmlrpc.createClient({host: 'localhost', port: 9090, cookies: true}); +var client = xmlrpc.createClient({ + host: 'localhost', + port: 9090, + cookies: true +}); + client.setCookie('login', 'bilbo'); + //This call will send provided cookie to the server client.methodCall('someAction', [], function(error, value) { - //Here we may get cookie received from server if we know its name - console.log(client.getCookie('session')); + //Here we may get cookie received from server if we know its name + console.log(client.getCookie('session')); }); ``` From d0daa25e9557b69435115d1bffec5a20b1d9d795 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Fri, 9 Jan 2015 13:57:52 +0100 Subject: [PATCH 3/4] Fix copyright year in license file --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index efe6165..7981eab 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011 Brandon Ace Alexander +Copyright (c) 2011-2015 Brandon Ace Alexander Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation From 9385b172ae071688f81e07c695ed043858a17d37 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Fri, 9 Jan 2015 13:59:05 +0100 Subject: [PATCH 4/4] Updates to 1.3.0 --- HISTORY.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 2752a22..62ddb57 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,10 @@ +## 1.3.0 / 2015-01-09 + + * Reworked DateFormatter to improve ISO-8601 implementation. + * Updates XMLBuilder to 2.4. + * Updates sax to 0.6. + * Adds more detail to Client request errors to ease debugging. + ## 1.2.0 / 2014-01-12 * Adds (tested) support for Node v0.10 and v0.11. diff --git a/package.json b/package.json index 2e583a0..5477d06 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name" : "xmlrpc" , "description" : "A pure JavaScript XML-RPC client and server." , "keywords" : [ "xml-rpc", "xmlrpc", "xml", "rpc" ] -, "version" : "1.2.0" +, "version" : "1.3.0" , "preferGlobal" : false , "homepage" : "https://github.com/baalexander/node-xmlrpc" , "author" : "Brandon Alexander (https://github.com/baalexander)"