fix: Set instance variables at initialization to avoid spamming rake warnings
This commit is contained in:
parent
efb9b7897a
commit
2cd6af174d
|
@ -257,6 +257,9 @@ module Google
|
|||
CredentialsLoader.warn_if_cloud_sdk_credentials @client.client_id
|
||||
@project_id ||= CredentialsLoader.load_gcloud_project_id
|
||||
@client.fetch_access_token!
|
||||
@env_vars = nil
|
||||
@paths = nil
|
||||
@scope = nil
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ module Signet
|
|||
end
|
||||
|
||||
def on_refresh &block
|
||||
@refresh_listeners ||= []
|
||||
@refresh_listeners = [] unless defined? @refresh_listeners
|
||||
@refresh_listeners << block
|
||||
end
|
||||
|
||||
|
@ -84,7 +84,7 @@ module Signet
|
|||
end
|
||||
|
||||
def notify_refresh_listeners
|
||||
listeners = @refresh_listeners || []
|
||||
listeners = defined?(@refresh_listeners) ? @refresh_listeners : []
|
||||
listeners.each do |block|
|
||||
block.call self
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue