aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-09-24 19:24:46 +0100
committerMike McQuaid2017-09-24 21:23:59 +0100
commit01e9ec9a9f723b2ef89c7adfaea39f9e4db9aede (patch)
treeee2cba40aabe7bd2b103f75cb61d5af3a83104d3 /Library/Homebrew/formula.rb
parent9eb51db400261545822c8c03c2e9d587d70e8ad0 (diff)
downloadbrew-01e9ec9a9f723b2ef89c7adfaea39f9e4db9aede.tar.bz2
Rubocop: automatic rule fixes.
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 2f0c913c2..69a4cd5aa 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -472,7 +472,7 @@ class Formula
return true if devel && tab.devel_version && tab.devel_version < devel.version
if options[:fetch_head]
- return false unless head && head.downloader.is_a?(VCSDownloadStrategy)
+ return false unless head&.downloader.is_a?(VCSDownloadStrategy)
downloader = head.downloader
downloader.shutup! unless ARGV.verbose?
downloader.commit_outdated?(version.version.commit)
@@ -1115,8 +1115,8 @@ class Formula
# @private
def unlock
- @lock.unlock unless @lock.nil?
- @oldname_lock.unlock unless @oldname_lock.nil?
+ @lock&.unlock
+ @oldname_lock&.unlock
end
def migration_needed?
@@ -1440,7 +1440,7 @@ class Formula
# True if this formula is provided by Homebrew itself
# @private
def core_formula?
- tap && tap.core_tap?
+ tap&.core_tap?
end
# True if this formula is provided by external Tap
@@ -1525,10 +1525,10 @@ class Formula
"oldname" => oldname,
"aliases" => aliases,
"versions" => {
- "stable" => (stable.version.to_s if stable),
+ "stable" => stable&.version.to_s,
"bottle" => bottle ? true : false,
- "devel" => (devel.version.to_s if devel),
- "head" => (head.version.to_s if head),
+ "devel" => devel&.version.to_s,
+ "head" => head&.version.to_s,
},
"revision" => revision,
"version_scheme" => version_scheme,