Skip to content

Commit

Permalink
Merge pull request #49 from aydrian/ISSUE-48
Browse files Browse the repository at this point in the history
Issue 48 Add Grunt Bump
  • Loading branch information
aydrian committed May 12, 2015
2 parents cb81a45 + 176ff93 commit 7ed788f
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 18 deletions.
18 changes: 16 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var trans = {
recipients: [{ address: { email: '[email protected]' } }]
};

client.transmission.send(trans, function(err, res) {
client.transmissions.send(trans, function(err, res) {
if (err) {
console.log(err);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var trans = {
recipients: [{ address: { email: '[email protected]' } }]
};

client.transmission.send(trans, function(err, res) {
client.transmissions.send(trans, function(err, res) {
if (err) {
console.log(err);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/SendGridCompatibility/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/sparkpost.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions test/spec/SendGridCompatibility/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: ['[email protected]', '[email protected]'],
toname: ['Fakey Fakerson', 'Realy Realerson'],
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/spec/transmissions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 7ed788f

Please sign in to comment.