make load_gcloud_project_id module function (#170)

This commit is contained in:
Graham Paye authored and GitHub committed 2018-10-26 12:17:12 -07:00
1 parent f0b0c6f8e8
commit 0d2becbdcd
6 files changed
+11 -6

No files matched your search

+1
View File
@@ -147,6 +147,7 @@ module Google
rescue
warn 'Unable to determine project id.'
end
module_function :load_gcloud_project_id
private
+2 -2
View File
@@ -65,7 +65,7 @@ module Google
client_email = ENV[CredentialsLoader::CLIENT_EMAIL_VAR]
project_id = ENV[CredentialsLoader::PROJECT_ID_VAR]
end
project_id ||= self.class.load_gcloud_project_id
project_id ||= CredentialsLoader.load_gcloud_project_id
new(token_credential_uri: TOKEN_CRED_URI,
audience: TOKEN_CRED_URI,
@@ -157,7 +157,7 @@ module Google
@issuer = ENV[CredentialsLoader::CLIENT_EMAIL_VAR]
@project_id = ENV[CredentialsLoader::PROJECT_ID_VAR]
end
@project_id ||= self.class.load_gcloud_project_id
@project_id ||= CredentialsLoader.load_gcloud_project_id
@signing_key = OpenSSL::PKey::RSA.new(@private_key)
end
+1 -1
View File
@@ -90,7 +90,7 @@ module Google
options[:token_credential_uri] ||= TOKEN_CRED_URI
options[:authorization_uri] ||= AUTHORIZATION_URI
@project_id = options[:project_id]
@project_id ||= self.class.load_gcloud_project_id
@project_id ||= CredentialsLoader.load_gcloud_project_id
super(options)
end
+1 -1
View File
@@ -31,6 +31,6 @@ module Google
# Module Auth provides classes that provide Google-specific authorization
# used to access Google APIs.
module Auth
VERSION = '0.7.0'.freeze
VERSION = '0.7.1'.freeze
end
end