Comparing version 1.0.0 to 1.1.1
@@ -29,5 +29,4 @@ "use strict"; | ||
}, | ||
restBase: 'https://www.gittip.com/', | ||
paydaysURL: 'about/paydays.json', | ||
statsURL: 'about/stats.json' | ||
restBase: 'https://gratipay.com/', | ||
paydaysURL: 'about/paydays.json' | ||
}; | ||
@@ -37,3 +36,3 @@ this.options = utils.merge(this.defaults, options); | ||
/** | ||
/** | ||
* Issues an HTTPS Get request. | ||
@@ -98,15 +97,2 @@ * | ||
/** | ||
* Function for requesting and returning Gittip's statistical data in JSON form. | ||
* | ||
* @param {Function} callback Callback function that will be called when the processing is done. | ||
*/ | ||
Gittip.prototype.getStats = function (callback) { | ||
var url = this.options.restBase + this.options.statsURL; | ||
this.get(url, null, function(data) { | ||
callback(data); | ||
}); | ||
return this; | ||
} | ||
/** | ||
* Function for requesting and returning a Gittip User's public data in JSON form. | ||
@@ -121,3 +107,3 @@ * | ||
this.options.key = options.key | ||
} | ||
} | ||
else if (!this.options.key) { | ||
@@ -142,3 +128,3 @@ throw new Error('No Gittip API key supplied.'); | ||
* | ||
* @param {Object} options Options object that contains the user's name to lookup and | ||
* @param {Object} options Options object that contains the user's name to lookup and | ||
* required API key if not set when intializing client. | ||
@@ -152,3 +138,3 @@ * | ||
var options = { | ||
url: 'https://www.gittip.com/kevintcoughlin/tips.json', | ||
url: 'https://www.gratipay.com/kevintcoughlin/tips.json', | ||
auth: { | ||
@@ -180,3 +166,3 @@ username: 'API_KEY', | ||
this.options.key = options.key | ||
} | ||
} | ||
else if (!this.options.key) { | ||
@@ -198,3 +184,3 @@ throw new Error('No Gittip API key supplied.'); | ||
* | ||
* @param {Object} options Options object that contains the user's name to lookup and | ||
* @param {Object} options Options object that contains the user's name to lookup and | ||
* required API key if not set when intializing client. | ||
@@ -208,2 +194,2 @@ * | ||
module.exports = Gittip; | ||
module.exports = Gittip; |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "1.0.0", | ||
"version": "1.1.1", | ||
"author": "Kevin Coughlin <kevintcoughlin@gmail.com>", | ||
@@ -16,0 +16,0 @@ "license": "MIT", |
@@ -1,5 +0,5 @@ | ||
/** | ||
/** | ||
* Tests for Gittip's REST API | ||
* Test Framework: Mocha (http://visionmedia.github.io/mocha/) | ||
* Assertions: Should (https://github.com/visionmedia/should.js/) | ||
* Assertions: Should (https://github.com/visionmedia/should.js/) | ||
*/ | ||
@@ -10,3 +10,3 @@ | ||
, request = require('supertest') | ||
, request = request('https://www.gittip.com/') | ||
, request = request('https://gratipay.com/') | ||
, g; | ||
@@ -34,7 +34,7 @@ | ||
describe('Gittip API - Stats', function () { | ||
describe('Gittip API - User Public Data', function () { | ||
this.timeout(15000); | ||
it('responds with JSON', function (done) { | ||
request | ||
.get(g.defaults.statsURL) | ||
.get('/~kevintcoughlin/public.json') | ||
.set('Accept', 'application/json') | ||
@@ -50,17 +50,1 @@ .expect(200) | ||
}); | ||
describe('Gittip API - User Public Data', function () { | ||
this.timeout(15000); | ||
it('responds with JSON', function (done) { | ||
request | ||
.get('/kevintcoughlin/public.json') | ||
.set('Accept', 'application/json') | ||
.expect(200) | ||
.end(function(err, res) { | ||
should.not.exist(err); | ||
res.header['content-type'].should.eql('application/json'); | ||
res.body.should.exit; | ||
done(); | ||
}); | ||
}); | ||
}); |
@@ -1,5 +0,5 @@ | ||
/** | ||
/** | ||
* Tests for Gittip client creation | ||
* Test Framework: Mocha (http://visionmedia.github.io/mocha/) | ||
* Assertions: Should (https://github.com/visionmedia/should.js/) | ||
* Assertions: Should (https://github.com/visionmedia/should.js/) | ||
*/ | ||
@@ -21,5 +21,4 @@ var Gittip = require('..') | ||
}, | ||
restBase: 'https://www.gittip.com/', | ||
paydaysURL: 'about/paydays.json', | ||
statsURL: 'about/stats.json' | ||
restBase: 'https://gratipay.com/', | ||
paydaysURL: 'about/paydays.json' | ||
}; | ||
@@ -33,7 +32,6 @@ | ||
var g = new Gittip(); | ||
g.defaults.restBase.should.equal('https://www.gittip.com/'); | ||
g.defaults.restBase.should.equal('https://gratipay.com/'); | ||
g.defaults.paydaysURL.should.equal('about/paydays.json'); | ||
g.defaults.statsURL.should.equal('about/stats.json'); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -1,5 +0,5 @@ | ||
/** | ||
/** | ||
* Tests for HTTP GET requests | ||
* Test Framework: Mocha (http://visionmedia.github.io/mocha/) | ||
* Assertions: Should (https://github.com/visionmedia/should.js/) | ||
* Assertions: Should (https://github.com/visionmedia/should.js/) | ||
*/ | ||
@@ -55,12 +55,2 @@ var Gittip = require('..'), | ||
describe('g.getStats()', function () { | ||
this.timeout(15000); | ||
it('should successfully complete request', function (done) { | ||
g.getStats(function(data) { | ||
should.exist(data); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('g.getUser()', function () { | ||
@@ -74,2 +64,2 @@ this.timeout(15000); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15918
362