aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/download_strategy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
-rw-r--r--Library/Homebrew/download_strategy.rb26
1 files changed, 10 insertions, 16 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 7012fccc8..f9a359450 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -18,8 +18,7 @@ class AbstractDownloadStrategy
end
# Download and cache the resource as {#cached_location}.
- def fetch
- end
+ def fetch; end
# Suppress output
def shutup!
@@ -37,13 +36,11 @@ class AbstractDownloadStrategy
# Unpack {#cached_location} into the current working directory, and possibly
# chdir into the newly-unpacked directory.
# Unlike {Resource#stage}, this does not take a block.
- def stage
- end
+ def stage; end
# @!attribute [r] cached_location
# The path to the cached file or directory associated with the resource.
- def cached_location
- end
+ def cached_location; end
# @!attribute [r]
# return most recent modified time for all files in the current working directory after stage.
@@ -162,7 +159,7 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
return unless @ref_type == :tag
return unless @revision && current_revision
return if current_revision == @revision
- raise <<-EOS.undent
+ raise <<~EOS
#{@ref} tag should be #{@revision}
but is actually #{current_revision}
EOS
@@ -204,14 +201,11 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
true
end
- def clone_repo
- end
+ def clone_repo; end
- def update
- end
+ def update; end
- def current_revision
- end
+ def current_revision; end
def extract_ref(specs)
key = REF_TYPES.find { |type| specs.key?(type) }
@@ -559,9 +553,9 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
rescue GitHub::HTTPNotFoundError
# We only handle HTTPNotFoundError here,
# becase AuthenticationFailedError is handled within util/github.
- message = <<-EOS.undent
- HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo}
- This token may not have permission to access the repository or the url of formula may be incorrect.
+ message = <<~EOS
+ HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo}
+ This token may not have permission to access the repository or the url of formula may be incorrect.
EOS
raise CurlDownloadStrategyError, message
end