From aa5c254dc76a71cde069e67b1e8b1acbd2103647 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 9 Sep 2016 15:19:15 -0400 Subject: [PATCH] all modules: ensure all User-Agents are set (#1568) --- packages/google-cloud-resourcemanager/package.json | 2 +- packages/google-cloud-resourcemanager/src/index.js | 4 +--- packages/google-cloud-resourcemanager/test/index.js | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-resourcemanager/package.json b/packages/google-cloud-resourcemanager/package.json index 37d969c7e4e..b9e35b85edc 100644 --- a/packages/google-cloud-resourcemanager/package.json +++ b/packages/google-cloud-resourcemanager/package.json @@ -50,7 +50,7 @@ "resource" ], "dependencies": { - "@google-cloud/common": "^0.1.0", + "@google-cloud/common": "^0.5.0", "extend": "^3.0.0", "is": "^3.0.1" }, diff --git a/packages/google-cloud-resourcemanager/src/index.js b/packages/google-cloud-resourcemanager/src/index.js index 88f0134cf29..0a9df2fdd31 100644 --- a/packages/google-cloud-resourcemanager/src/index.js +++ b/packages/google-cloud-resourcemanager/src/index.js @@ -31,8 +31,6 @@ var util = require('util'); */ var Project = require('./project.js'); -var PKG = require('../package.json'); - /** *

* **This is a Beta release of Cloud Resource Manager.** This feature is not @@ -69,7 +67,7 @@ function Resource(options) { baseUrl: 'https://cloudresourcemanager.googleapis.com/v1beta1', scopes: ['https://www.googleapis.com/auth/cloud-platform'], projectIdRequired: false, - userAgent: PKG.name + '/' + PKG.version + packageJson: require('../package.json') }; common.Service.call(this, config, options); diff --git a/packages/google-cloud-resourcemanager/test/index.js b/packages/google-cloud-resourcemanager/test/index.js index d0ac5dc8631..07a39e6adf5 100644 --- a/packages/google-cloud-resourcemanager/test/index.js +++ b/packages/google-cloud-resourcemanager/test/index.js @@ -24,8 +24,6 @@ var proxyquire = require('proxyquire'); var Service = require('@google-cloud/common').Service; var util = require('@google-cloud/common').util; -var PKG = require('../package.json'); - function FakeProject() { this.calledWith_ = [].slice.call(arguments); } @@ -126,7 +124,7 @@ describe('Resource', function() { 'https://www.googleapis.com/auth/cloud-platform' ]); assert.strictEqual(resource.projectIdRequired, false); - assert.strictEqual(calledWith.userAgent, PKG.name + '/' + PKG.version); + assert.deepEqual(calledWith.packageJson, require('../package.json')); }); });