Fix rubocop Ruby 1.9.3 compatibility issues

This commit is contained in:
Heng Xiong committed 2017-07-12 17:11:49 -07:00
1 parent 374b342ea9
commit 1db30f6db1
8 files changed
+17 -10

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ module Google
# JSON key.
def self.read_json_key(json_key_io)
json_key = MultiJson.load(json_key_io.read)
wanted = %w[client_id client_secret refresh_token]
wanted = %w(client_id client_secret refresh_token)
wanted.each do |key|
raise "the json is missing the #{key} field" unless json_key.key?(key)
end
+1 -1
View File
@@ -227,7 +227,7 @@ module Google
# @param [Rack::Request] request
# Current request
def self.validate_callback_state(state, request)
if state[AUTH_CODE_KEY].nil? # rubocop:disable Style/GuardClause
if state[AUTH_CODE_KEY].nil?
raise Signet::AuthorizationError, MISSING_AUTH_CODE_ERROR
elsif state[ERROR_CODE_KEY]
raise Signet::AuthorizationError,