aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/pull.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-12 08:09:29 +0100
committerGitHub2016-09-12 08:09:29 +0100
commit59116d08ca5fd430345af39fddca48ffa1e9d114 (patch)
treeb01940e8ac5b1c81dec5f0c89f730d5b0c30e515 /Library/Homebrew/dev-cmd/pull.rb
parent9a6999c30276a05c0bfc89f03b91dea4371ed407 (diff)
parent51bda9c90efe3c3fbc197b6c1db793575444a711 (diff)
downloadbrew-59116d08ca5fd430345af39fddca48ffa1e9d114.tar.bz2
Merge pull request #927 from MikeMcQuaid/dev-cmd-rubocop
Fix Library/Homebrew/dev-cmd RuboCop warnings
Diffstat (limited to 'Library/Homebrew/dev-cmd/pull.rb')
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index e18bf1c2f..a59792281 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -237,7 +237,7 @@ module Homebrew
private
- def publish_changed_formula_bottles(tap, changed_formulae_names)
+ def publish_changed_formula_bottles(_tap, changed_formulae_names)
if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"]
raise "Need to load formulae to publish them!"
end
@@ -360,7 +360,13 @@ module Homebrew
def subject_for_bump(formula, old, new)
if old[:nonexistent]
# New formula
- headline_ver = new[:stable] ? new[:stable] : new[:devel] ? new[:devel] : new[:head]
+ headline_ver = if new[:stable]
+ new[:stable]
+ elsif new[:devel]
+ new[:devel]
+ else
+ new[:head]
+ end
subject = "#{formula.name} #{headline_ver} (new formula)"
else
# Update to existing formula
@@ -430,7 +436,7 @@ module Homebrew
FormulaInfoFromJson.new(Utils::JSON.load(json)[0])
end
- def bottle_tags()
+ def bottle_tags
return [] unless info["bottle"]["stable"]
info["bottle"]["stable"]["files"].keys
end
@@ -467,7 +473,6 @@ module Homebrew
end
end
-
# Bottle info as used internally by pull, with alternate platform support
class BottleInfo
# URL of bottle as string
@@ -522,7 +527,7 @@ module Homebrew
http.use_ssl = true
retry_count = 0
http.start do
- while true do
+ loop do
req = Net::HTTP::Head.new bottle_info.url
req.initialize_http_header "User-Agent" => HOMEBREW_USER_AGENT_RUBY
res = http.request req
@@ -551,7 +556,7 @@ module Homebrew
max_curl_retries = 1
retry_count = 0
# We're in the cache; make sure to force re-download
- while true do
+ loop do
begin
curl url, "-o", filename
break