diff options
| author | Mike McQuaid | 2017-09-25 21:29:03 +0100 |
|---|---|---|
| committer | GitHub | 2017-09-25 21:29:03 +0100 |
| commit | a5893036166b9708d705a5060aa85002d5a6be16 (patch) | |
| tree | 03a254a34d12926540a0be677ffc8c9b9f32d5d0 /Library/Homebrew/cmd | |
| parent | ac8b58537fe3dd71098a43afcc6a1785dcde1d39 (diff) | |
| parent | cf5fdeef1d8e9fd053121145882835b87eec2a43 (diff) | |
| download | brew-a5893036166b9708d705a5060aa85002d5a6be16.tar.bz2 | |
Merge pull request #3183 from MikeMcQuaid/rubocop-upgrade
Rubocop: 0.50.0 and Ruby 2.3
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/prune.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/search.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/tap-info.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/unlinkapps.rb | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb index 9fc6dbcd9..7ec2838ba 100644 --- a/Library/Homebrew/cmd/prune.rb +++ b/Library/Homebrew/cmd/prune.rb @@ -55,7 +55,7 @@ module Homebrew else n, d = ObserverPathnameExtension.counts print "Pruned #{n} symbolic links " - print "and #{d} directories " if d > 0 + print "and #{d} directories " if d.positive? puts "from #{HOMEBREW_PREFIX}" end end diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index acee9817f..c01a11c10 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -67,7 +67,7 @@ module Homebrew ohai "Searching blacklisted, migrated and deleted formulae..." if reason = Homebrew::MissingFormula.reason(query, silent: true) - if count > 0 + if count.positive? puts puts "If you meant #{query.inspect} specifically:" end diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index af087645d..cb0e0b387 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -64,10 +64,10 @@ module Homebrew if tap.installed? info += tap.pinned? ? "pinned" : "unpinned" info += ", private" if tap.private? - if (formula_count = tap.formula_files.size) > 0 + if (formula_count = tap.formula_files.size).positive? info += ", #{Formatter.pluralize(formula_count, "formula")}" end - if (command_count = tap.command_files.size) > 0 + if (command_count = tap.command_files.size).positive? info += ", #{Formatter.pluralize(command_count, "command")}" end info += ", no formulae/commands" if (formula_count + command_count).zero? diff --git a/Library/Homebrew/cmd/unlinkapps.rb b/Library/Homebrew/cmd/unlinkapps.rb index 7cae97e27..56dba3603 100644 --- a/Library/Homebrew/cmd/unlinkapps.rb +++ b/Library/Homebrew/cmd/unlinkapps.rb @@ -77,7 +77,7 @@ module Homebrew def unlinkapps_unlink?(target_app, opts = {}) # Skip non-symlinks and symlinks that don't point into the Homebrew prefix. app = target_app.readlink.to_s if target_app.symlink? - return false unless app && app.start_with?(*UNLINKAPPS_PREFIXES) + return false unless app&.start_with?(*UNLINKAPPS_PREFIXES) if opts.fetch(:prune, false) !File.exist?(app) # Remove only broken symlinks in prune mode. |
