chore: RuboCop lint Naming/MemoizedInstanceVariableName

This commit is contained in:
Olle Jonsson 2019-02-27 20:22:40 +01:00
parent 9e25ee6adc
commit 2fa4043f21
2 changed files with 8 additions and 11 deletions

View File

@ -121,13 +121,11 @@ module Faraday
return ssl[:cert_store] if ssl[:cert_store]
# Memoize the cert store so that the same one is passed to
# HTTPClient each time, to avoid resyncing SSL sesions when
# HTTPClient each time, to avoid resyncing SSL sessions when
# it's changed
@cert_store ||= begin
@ssl_cert_store ||= begin
# Use the default cert store by default, i.e. system ca certs
cert_store = OpenSSL::X509::Store.new
cert_store.set_default_paths
cert_store
OpenSSL::X509::Store.new.tap(&:set_default_paths)
end
end

View File

@ -32,7 +32,7 @@ module Faraday
NET_HTTP_EXCEPTIONS << Net::OpenTimeout if defined?(Net::OpenTimeout)
def initialize(app = nil, opts = {}, &block)
@cert_store = nil
@ssl_cert_store = nil
super(app, opts, &block)
end
@ -168,12 +168,11 @@ module Faraday
def ssl_cert_store(ssl)
return ssl[:cert_store] if ssl[:cert_store]
return @cert_store if @cert_store
@ssl_cert_store ||= begin
# Use the default cert store by default, i.e. system ca certs
@cert_store = OpenSSL::X509::Store.new
@cert_store.set_default_paths
@cert_store
OpenSSL::X509::Store.new.tap(&:set_default_paths)
end
end
def ssl_verify_mode(ssl)