Merge pull request #208 from blowmage/fix-warnings

Fix warnings
This commit is contained in:
Tim Emiola 2015-03-25 17:16:41 -07:00
commit 0b1dbb67fe
6 changed files with 39 additions and 37 deletions

View File

@ -490,7 +490,7 @@ module Google
else
check_cached_certs = lambda do
valid = false
for key, cert in @certificates
for _key, cert in @certificates
begin
self.authorization.decoded_id_token(cert.public_key)
valid = true

View File

@ -31,8 +31,8 @@ module Google
#
# @return [OpenSSL::PKey] The private key for signing assertions.
def self.load_from_pkcs12(keyfile, passphrase)
load_key(keyfile, passphrase) do |content, passphrase|
OpenSSL::PKCS12.new(content, passphrase).key
load_key(keyfile, passphrase) do |content, pass_phrase|
OpenSSL::PKCS12.new(content, pass_phrase).key
end
end
@ -49,8 +49,8 @@ module Google
# @return [OpenSSL::PKey] The private key for signing assertions.
#
def self.load_from_pem(keyfile, passphrase)
load_key(keyfile, passphrase) do | content, passphrase|
OpenSSL::PKey::RSA.new(content, passphrase)
load_key(keyfile, passphrase) do | content, pass_phrase|
OpenSSL::PKey::RSA.new(content, pass_phrase)
end
end

View File

@ -38,6 +38,7 @@ module Google
# @params [Object] Storage object
def initialize(store)
@store= store
@authorization = nil
end
##

View File

@ -87,6 +87,7 @@ module Google
# block to be called when result ready
def initialize(options = {}, &block)
@calls = []
@global_callback = nil
@global_callback = block if block_given?
@last_auto_id = 0
@ -165,7 +166,7 @@ module Google
if @calls.nil? || @calls.empty?
raise BatchError, 'Cannot make an empty batch request'
end
parts = @calls.map {|(call_id, call, callback)| serialize_call(call_id, call)}
parts = @calls.map {|(call_id, call, _callback)| serialize_call(call_id, call)}
build_multipart(parts, 'multipart/mixed', BATCH_BOUNDARY)
super
end
@ -224,7 +225,7 @@ module Google
raise BatchError, 'Invalid value for Content-ID: "%s"' % header
end
base, call_id = header[1...-1].split('+')
_base, call_id = header[1...-1].split('+')
return Addressable::URI.unencode(call_id)
end
@ -268,7 +269,7 @@ module Google
def deserialize_call_response(call_response)
outer_headers, outer_body = split_headers_and_body(call_response)
status_line, payload = outer_body.split("\n", 2)
protocol, status, reason = status_line.split(' ', 3)
_protocol, status, _reason = status_line.split(' ', 3)
headers, body = split_headers_and_body(payload)
content_id = find_header('Content-ID', outer_headers)

View File

@ -244,7 +244,7 @@ module Google
)
end
request_env = http_request.to_env(connection)
http_request.to_env(connection)
end
##

View File

@ -124,7 +124,7 @@ module Google
# Read the entire cache file from disk.
# Will avoid reading if there have been no changes.
def read_file
if !File.exists? @file_path
if !File.exist? @file_path
@cache = nil
else
# Check for changes after our last read or write.