Skip to content

Commit

Permalink
all modules: ensure all User-Agents are set (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored and callmehiphop committed Sep 9, 2016
1 parent 676e759 commit b49bab0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-compute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"compute engine"
],
"dependencies": {
"@google-cloud/common": "^0.1.0",
"@google-cloud/common": "^0.5.0",
"arrify": "^1.0.0",
"async": "^1.4.2",
"create-error-class": "^2.0.1",
Expand Down
4 changes: 1 addition & 3 deletions packages/google-cloud-compute/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ var Snapshot = require('./snapshot.js');
*/
var Zone = require('./zone.js');

var PKG = require('../package.json');

/**
* @alias module:compute
* @constructor
Expand All @@ -99,7 +97,7 @@ function Compute(options) {
var config = {
baseUrl: 'https://www.googleapis.com/compute/v1',
scopes: ['https://www.googleapis.com/auth/compute'],
userAgent: PKG.name + '/' + PKG.version
packageJson: require('../package.json')
};

common.Service.call(this, config, options);
Expand Down
4 changes: 1 addition & 3 deletions packages/google-cloud-compute/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ var proxyquire = require('proxyquire');
var Service = require('@google-cloud/common').Service;
var util = require('@google-cloud/common').util;

var PKG = require('../package.json');

var slice = Array.prototype.slice;

var fakeUtil = extend({}, util, {
Expand Down Expand Up @@ -183,7 +181,7 @@ describe('Compute', function() {
assert.deepEqual(calledWith.scopes, [
'https://www.googleapis.com/auth/compute'
]);
assert.strictEqual(calledWith.userAgent, PKG.name + '/' + PKG.version);
assert.deepEqual(calledWith.packageJson, require('../package.json'));
});
});

Expand Down

0 comments on commit b49bab0

Please sign in to comment.