diff --git a/Gruntfile.js b/Gruntfile.js index 8c1a22e..a7ecb98 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,7 +17,7 @@ module.exports = function(grunt) { // Configure existing grunt tasks and create custom ones grunt.initConfig({ config: config, - + pkg: grunt.file.readJSON('package.json'), jshint: { files: [ 'index.js', @@ -29,7 +29,21 @@ module.exports = function(grunt) { jshintrc: './.jshintrc' } }, - + bump: { + options: { + files: [ 'package.json' ] + , updateConfigs: [ 'pkg' ] + , commit: true + , commitMessage: 'Release %VERSION%' + , commitFiles: [ 'package.json', 'README.md' ] + , createTag: true + , tagName: '%VERSION%' + , tagMessage: '%VERSION%' + , push: true + , pushTo: 'upstream' + , gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' + } + }, shell: { test: { command : '<%= config.binPath %>/istanbul cover --report lcov --dir test/reports/ <%= config.binPath %>/_mocha test/spec -- --reporter ' + reporter, diff --git a/README.md b/README.md index cf903a8..0621dc4 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Click on the desired API to see usage and more information * [Sending Domains](/docs/resources/sendingDomains.md) - `client.sendingDomains` ([examples](/examples/sendingDomains)) * [Suppression List](/docs/resources/suppressionList.md) - `client.suppressionList` ([examples](/examples/suppressionList)) * [Templates](/docs/resources/templates.md) - `client.templates` ([examples](/examples/templates)) -* [Transmissions](/docs/apis/transmission.md) - `client.transmission` ([examples](/examples/transmission)) +* [Transmissions](/docs/apis/transmissions.md) - `client.transmission` ([examples](/examples/transmissions)) * [Webhooks](/docs/resources/webhooks.md) - `client.webhooks` ([examples](/examples/webhooks)) diff --git a/docs/resources/transmission.md b/docs/resources/transmissions.md similarity index 99% rename from docs/resources/transmission.md rename to docs/resources/transmissions.md index 46826db..1c8b328 100644 --- a/docs/resources/transmission.md +++ b/docs/resources/transmissions.md @@ -39,7 +39,7 @@ trans.substitutionData = {name: 'YOUR FIRST NAME'}; trans.recipients = [{ address: { name: 'YOUR FULL NAME', email: 'YOUR EMAIL ADDRESS' } }]; // Send it off into the world! -client.transmission.send(trans, function(err, res) { +client.transmissions.send(trans, function(err, res) { if (err) { console.log('Whoops! Something went wrong'); console.log(err); diff --git a/examples/transmission/get_all_transmissions.js b/examples/transmissions/get_all_transmissions.js similarity index 83% rename from examples/transmission/get_all_transmissions.js rename to examples/transmissions/get_all_transmissions.js index e312a42..cf56dbf 100644 --- a/examples/transmission/get_all_transmissions.js +++ b/examples/transmissions/get_all_transmissions.js @@ -4,7 +4,7 @@ var key = 'YOURAPIKEY' , SparkPost = require('sparkpost') , client = new SparkPost(key); -client.transmission.all(function(err, res) { +client.transmissions.all(function(err, res) { if (err) { console.log(err); } else { diff --git a/examples/transmission/get_transmission.js b/examples/transmissions/get_transmission.js similarity index 76% rename from examples/transmission/get_transmission.js rename to examples/transmissions/get_transmission.js index f41d688..2f75daa 100644 --- a/examples/transmission/get_transmission.js +++ b/examples/transmissions/get_transmission.js @@ -4,7 +4,7 @@ var key = 'YOURAPIKEY' , SparkPost = require('sparkpost') , client = new SparkPost(key); -client.transmission.find('YOUR-TRANSMISSION-KEY', function(err, res) { +client.transmissions.find('YOUR-TRANSMISSION-KEY', function(err, res) { if (err) { console.log(err); } else { diff --git a/examples/transmission/mime_parts.js b/examples/transmissions/mime_parts.js similarity index 90% rename from examples/transmission/mime_parts.js rename to examples/transmissions/mime_parts.js index 5468746..dcda522 100644 --- a/examples/transmission/mime_parts.js +++ b/examples/transmissions/mime_parts.js @@ -14,7 +14,7 @@ var trans = { trackClicks: true }; -client.transmission.send(trans, function(err, res) { +client.transmissions.send(trans, function(err, res) { if (err) { console.log(err); } else { diff --git a/examples/transmission/rfc822.js b/examples/transmissions/rfc822.js similarity index 90% rename from examples/transmission/rfc822.js rename to examples/transmissions/rfc822.js index 5f2a637..b5022f4 100644 --- a/examples/transmission/rfc822.js +++ b/examples/transmissions/rfc822.js @@ -11,7 +11,7 @@ var trans = { subject: 'Example Email for RFC-822 Content' }; -client.transmission.send(trans, function(err, res) { +client.transmissions.send(trans, function(err, res) { if (err) { console.log(err); } else { diff --git a/examples/transmission/send_transmission_all_fields.js b/examples/transmissions/send_transmission_all_fields.js similarity index 94% rename from examples/transmission/send_transmission_all_fields.js rename to examples/transmissions/send_transmission_all_fields.js index d997907..ec84f78 100644 --- a/examples/transmission/send_transmission_all_fields.js +++ b/examples/transmissions/send_transmission_all_fields.js @@ -35,7 +35,7 @@ var trans = { ] }; -client.transmission.send(trans, function(err, res) { +client.transmissions.send(trans, function(err, res) { if (err) { console.log(err); } else { diff --git a/examples/transmission/stored_recipients_inline_content.js b/examples/transmissions/stored_recipients_inline_content.js similarity index 89% rename from examples/transmission/stored_recipients_inline_content.js rename to examples/transmissions/stored_recipients_inline_content.js index 0d57ac0..0ed8278 100644 --- a/examples/transmission/stored_recipients_inline_content.js +++ b/examples/transmissions/stored_recipients_inline_content.js @@ -12,7 +12,7 @@ var trans = { text: 'Hello World!' }; -client.transmission.send(trans, function(err, res) { +client.transmissions.send(trans, function(err, res) { if (err) { console.log(err); } else { diff --git a/examples/transmission/stored_recipients_stored_content.js b/examples/transmissions/stored_recipients_stored_content.js similarity index 89% rename from examples/transmission/stored_recipients_stored_content.js rename to examples/transmissions/stored_recipients_stored_content.js index 5d4bddf..66e227d 100644 --- a/examples/transmission/stored_recipients_stored_content.js +++ b/examples/transmissions/stored_recipients_stored_content.js @@ -12,7 +12,7 @@ var trans = { recipients: [{ address: { email: 'john.doe@example.com' } }] }; -client.transmission.send(trans, function(err, res) { +client.transmissions.send(trans, function(err, res) { if (err) { console.log(err); } else { diff --git a/examples/transmission/stored_template_send.js b/examples/transmissions/stored_template_send.js similarity index 89% rename from examples/transmission/stored_template_send.js rename to examples/transmissions/stored_template_send.js index 573848c..549065b 100644 --- a/examples/transmission/stored_template_send.js +++ b/examples/transmissions/stored_template_send.js @@ -11,7 +11,7 @@ var trans = { recipients: [{ address: { email: 'john.doe@example.com' } }] }; -client.transmission.send(trans, function(err, res) { +client.transmissions.send(trans, function(err, res) { if (err) { console.log(err); } else { diff --git a/lib/SendGridCompatibility/index.js b/lib/SendGridCompatibility/index.js index 85038e7..4146368 100644 --- a/lib/SendGridCompatibility/index.js +++ b/lib/SendGridCompatibility/index.js @@ -119,7 +119,7 @@ var translatePayload = function(payload) { */ sendgrid.prototype.send = function(payload, callback) { var translated = translatePayload(payload); - this.client.transmission.send(translated, callback); + this.client.transmissions.send(translated, callback); }; sendgrid.prototype.Email = require('./Email'); diff --git a/lib/sparkpost.js b/lib/sparkpost.js index 7ed5bba..4dae8b8 100644 --- a/lib/sparkpost.js +++ b/lib/sparkpost.js @@ -59,7 +59,7 @@ var SparkPost = function(apiKey, options) { this.sendingDomains = require('./sendingDomains')(this); this.suppressionList = require('./suppressionList')(this); this.templates = require('./templates')(this); - this.transmission = require('./transmission')(this); + this.transmissions = require('./transmissions')(this); this.webhooks = require('./webhooks')(this); }; diff --git a/lib/transmission.js b/lib/transmissions.js similarity index 100% rename from lib/transmission.js rename to lib/transmissions.js diff --git a/package.json b/package.json index 43191e1..ef7fe70 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "devDependencies": { "chai": "1.9.1", "grunt": "0.4.5", + "grunt-bump": "^0.3.1", "grunt-contrib-jshint": "0.10.0", "grunt-shell": "1.1.1", "istanbul": "0.3.2", diff --git a/test/spec/SendGridCompatibility/index.spec.js b/test/spec/SendGridCompatibility/index.spec.js index b0fda63..719f68d 100644 --- a/test/spec/SendGridCompatibility/index.spec.js +++ b/test/spec/SendGridCompatibility/index.spec.js @@ -9,7 +9,7 @@ chai.use(sinonChai); describe('SendGrid Compatibility', function() { var sendgrid = new sendGridCompatibility('asdf', 'asdf') - , transmission = sendgrid.client.transmission + , transmissions = sendgrid.client.transmissions , payload = { to: ['fake@email.org', 'real@notreally.net'], toname: ['Fakey Fakerson', 'Realy Realerson'], @@ -77,14 +77,14 @@ describe('SendGrid Compatibility', function() { var sendSpy, scope; beforeEach(function() { - sendSpy = sinon.spy(transmission, 'send'); + sendSpy = sinon.spy(transmissions, 'send'); scope = nock('https://api.sparkpost.com') .post('/api/v1/transmissions') .reply(200, { ok: true }); }); afterEach(function() { - transmission.send.restore(); // restoring function + transmissions.send.restore(); // restoring function }); it('should handle an absence of toname', function(done) { diff --git a/test/spec/transmissions.spec.js b/test/spec/transmissions.spec.js index e06c89e..90fe536 100644 --- a/test/spec/transmissions.spec.js +++ b/test/spec/transmissions.spec.js @@ -14,7 +14,7 @@ describe('Transmissions Library', function() { post: sinon.stub().yields() }; - transmission = require('../../lib/transmission')(client); + transmission = require('../../lib/transmissions')(client); }); describe('all Method', function() {