1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add a custom log warning on load error.

This commit is contained in:
Dan Prince 2013-05-04 19:26:24 -04:00
parent d81cc071d2
commit 1c96372672

View file

@ -76,7 +76,11 @@ module Fog
google_client_email = options[:google_client_email]
@api_url = base_url + api_version + '/projects/'
#NOTE: loaded here to avoid requiring this as a core Fog dependency
require 'google/api_client'
begin
require 'google/api_client'
rescue LoadError
Fog::Logger.warning("Please install the google-api-client gem before using this provider.")
end
key = ::Google::APIClient::KeyUtils.load_from_pkcs12(File.expand_path(options[:google_key_location]), 'notasecret')
@client = ::Google::APIClient.new({