From d765472f3576732a0593b3f98e7f6a52a6f72ee2 Mon Sep 17 00:00:00 2001 From: Graham Paye Date: Thu, 21 Feb 2019 14:38:34 -0800 Subject: [PATCH] switch gcloud command to IO.popen from backticks (#194) --- lib/googleauth/credentials_loader.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/googleauth/credentials_loader.rb b/lib/googleauth/credentials_loader.rb index 265fda2..99a5ee6 100644 --- a/lib/googleauth/credentials_loader.rb +++ b/lib/googleauth/credentials_loader.rb @@ -174,7 +174,8 @@ module Google def load_gcloud_project_id gcloud = GCLOUD_WINDOWS_COMMAND if OS.windows? gcloud = GCLOUD_POSIX_COMMAND unless OS.windows? - config = MultiJson.load(`#{gcloud} #{GCLOUD_CONFIG_COMMAND}`) + gcloud_json = IO.popen("#{gcloud} #{GCLOUD_CONFIG_COMMAND}", &:read) + config = MultiJson.load gcloud_json config['configuration']['properties']['core']['project'] rescue nil