Skip to content
Snippets Groups Projects
Commit 5ce561c4 authored by Jonathan Chang's avatar Jonathan Chang
Browse files

rubocop: fix Naming/MemoizedInstanceVariableName

parent 05d7821c
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,11 @@ Layout/RescueEnsureAlignment:
Lint/AmbiguousBlockAssociation:
Enabled: false
# needed for lazy_object magic
Naming/MemoizedInstanceVariableName:
Exclude:
- 'Homebrew/lazy_object.rb'
# so many of these in formulae and can't be autocorrected
# TODO: fix these as `ruby -w` complains about them.
Lint/AmbiguousRegexpLiteral:
......
......@@ -142,9 +142,9 @@ module Cask
end
def language_eval
return @language if defined?(@language)
return @language_eval if defined?(@language_eval)
return @language = nil if @language_blocks.nil? || @language_blocks.empty?
return @language_eval = nil if @language_blocks.nil? || @language_blocks.empty?
raise CaskInvalidError.new(cask, "No default language specified.") if @language_blocks.default.nil?
......@@ -161,10 +161,10 @@ module Cask
next if key.nil?
return @language = @language_blocks[key].call
return @language_eval = @language_blocks[key].call
end
@language = @language_blocks.default.call
@language_eval = @language_blocks.default.call
end
def languages
......
......@@ -509,6 +509,12 @@ end
# @api public
class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy
def mirrors
combined_mirrors
end
private
def combined_mirrors
return @combined_mirrors if defined?(@combined_mirrors)
backup_mirrors = apache_mirrors.fetch("backup", [])
......@@ -517,8 +523,6 @@ class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy
@combined_mirrors = [*@mirrors, *backup_mirrors]
end
private
def resolve_url_basename_time(url)
if url == self.url
super("#{apache_mirrors["preferred"]}#{apache_mirrors["path_info"]}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment