Skip to content

Commit

Permalink
Merge pull request #95 from patricklodder/1.3.0-prep
Browse files Browse the repository at this point in the history
Release preparation for 1.3.0
  • Loading branch information
patricklodder committed Jan 9, 2015
2 parents 99d74e8 + 9385b17 commit f897370
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 13 deletions.
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});

```
Expand Down
2 changes: 1 addition & 1 deletion lib/date_formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> (https://github.com/baalexander)"
Expand Down
2 changes: 1 addition & 1 deletion test/client_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
//////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 4 additions & 3 deletions test/date_formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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() }
}
}
}
Expand Down Expand Up @@ -118,6 +118,7 @@ vows.describe('Date Formatter').addBatch({
}
}).export(module)

// HELPERS
function encodeCase (opts, reStr) {
return {
topic: function (d) {
Expand All @@ -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() }
}
}

Expand Down

0 comments on commit f897370

Please sign in to comment.