aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-23 11:01:40 +0200
committerMarkus Reiter2016-09-23 15:30:07 +0200
commitfe2d51e0b9d4d9c138e512c245b1ed8d0f1dbf53 (patch)
tree24c62806b60d59b0f9a689ac693a7afec5bd3291 /Library/Homebrew/dev-cmd
parenta5b11a6a5c7e29b9040f93fd211f52479507dd01 (diff)
downloadbrew-fe2d51e0b9d4d9c138e512c245b1ed8d0f1dbf53.tar.bz2
Fix Style/IfUnlessModifier.
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/bottle.rb8
-rw-r--r--Library/Homebrew/dev-cmd/edit.rb6
-rw-r--r--Library/Homebrew/dev-cmd/mirror.rb4
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb12
-rw-r--r--Library/Homebrew/dev-cmd/test-bot.rb16
5 files changed, 16 insertions, 30 deletions
diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb
index 797828e0e..b2aa3b2c5 100644
--- a/Library/Homebrew/dev-cmd/bottle.rb
+++ b/Library/Homebrew/dev-cmd/bottle.rb
@@ -108,9 +108,7 @@ module Homebrew
absolute_symlinks_start_with_string = []
keg.find do |pn|
next unless pn.symlink? && (link = pn.readlink).absolute?
- if link.to_s.start_with?(string)
- absolute_symlinks_start_with_string << pn
- end
+ absolute_symlinks_start_with_string << pn if link.to_s.start_with?(string)
end
if ARGV.verbose?
@@ -155,9 +153,7 @@ module Homebrew
return ofail "Formula not installed with '--build-bottle': #{f.full_name}"
end
- unless f.stable
- return ofail "Formula has no stable version: #{f.full_name}"
- end
+ return ofail "Formula has no stable version: #{f.full_name}" unless f.stable
if ARGV.include?("--no-rebuild") || !f.tap
rebuild = 0
diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb
index f80d05861..2d2a5ec08 100644
--- a/Library/Homebrew/dev-cmd/edit.rb
+++ b/Library/Homebrew/dev-cmd/edit.rb
@@ -33,9 +33,9 @@ module Homebrew
# Don't use ARGV.formulae as that will throw if the file doesn't parse
paths = ARGV.named.map do |name|
path = Formulary.path(name)
- unless path.file? || ARGV.force?
- raise FormulaUnavailableError, name
- end
+
+ raise FormulaUnavailableError, name unless path.file? || ARGV.force?
+
path
end
exec_editor(*paths)
diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb
index 162008123..9966163f8 100644
--- a/Library/Homebrew/dev-cmd/mirror.rb
+++ b/Library/Homebrew/dev-cmd/mirror.rb
@@ -4,9 +4,7 @@
module Homebrew
def mirror
- if ARGV.named.empty?
- odie "This command requires at least formula argument!"
- end
+ odie "This command requires at least formula argument!" if ARGV.named.empty?
bintray_user = ENV["BINTRAY_USER"]
bintray_key = ENV["BINTRAY_KEY"]
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index 7f027e159..b06719fb1 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -41,12 +41,12 @@ require "pkg_version"
module Homebrew
def pull
- if ARGV[0] == "--rebase"
- odie "You meant `git pull --rebase`."
- end
+ odie "You meant `git pull --rebase`." if ARGV[0] == "--rebase"
+
if ARGV.named.empty?
odie "This command requires at least one argument containing a URL or pull request number"
end
+
do_bump = ARGV.include?("--bump") && !ARGV.include?("--clean")
# Formulae with affected bottles that were published
@@ -429,9 +429,9 @@ module Homebrew
# Returns nil if formula is absent or if there was an error reading it
def self.lookup(name)
json = Utils.popen_read(HOMEBREW_BREW_FILE, "info", "--json=v1", name)
- unless $?.success?
- return nil
- end
+
+ return nil unless $?.success?
+
Homebrew.force_utf8!(json)
FormulaInfoFromJson.new(Utils::JSON.load(json)[0])
end
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb
index d63f88a1c..ba78cdb59 100644
--- a/Library/Homebrew/dev-cmd/test-bot.rb
+++ b/Library/Homebrew/dev-cmd/test-bot.rb
@@ -724,9 +724,7 @@ module Homebrew
coverage_args = []
if ARGV.include?("--coverage")
if ENV["JENKINS_HOME"]
- if OS.mac? && MacOS.version == :sierra
- coverage_args << "--coverage"
- end
+ coverage_args << "--coverage" if OS.mac? && MacOS.version == :sierra
else
coverage_args << "--coverage"
end
@@ -741,9 +739,7 @@ module Homebrew
test "brew", "cask-tests", *coverage_args
end
elsif @tap
- if @tap.name == "homebrew/core"
- test "brew", "style", @tap.name
- end
+ test "brew", "style", @tap.name if @tap.name == "homebrew/core"
test "brew", "readall", "--aliases", @tap.name
end
end
@@ -1054,9 +1050,7 @@ module Homebrew
ARGV << "--junit" << "--local" << "--test-default-formula"
end
- if ARGV.include? "--ci-master"
- ARGV << "--fast"
- end
+ ARGV << "--fast" if ARGV.include?("--ci-master")
if ARGV.include? "--local"
ENV["HOMEBREW_CACHE"] = "#{ENV["HOME"]}/Library/Caches/Homebrew"
@@ -1080,9 +1074,7 @@ module Homebrew
safe_system "brew", "tap", tap.name, "--full"
end
- if ARGV.include? "--ci-upload"
- return test_ci_upload(tap)
- end
+ return test_ci_upload(tap) if ARGV.include?("--ci-upload")
tests = []
any_errors = false