aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorL. E. Segovia2017-11-01 22:35:41 -0300
committerL. E. Segovia2017-11-01 22:35:41 -0300
commit7f398d01b8d5970677d490e120be616aa596ef8b (patch)
tree997c94f0c495ea12a26009941388a8fe3ef8d1b8 /Library
parentc636be07f97e4a659f038c51cab6f0efe2e83bfa (diff)
downloadbrew-7f398d01b8d5970677d490e120be616aa596ef8b.tar.bz2
Turn ifs into multiple lines
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/audit.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/audit.rb b/Library/Homebrew/cask/lib/hbc/audit.rb
index 4a5a40e4f..51316baec 100644
--- a/Library/Homebrew/cask/lib/hbc/audit.rb
+++ b/Library/Homebrew/cask/lib/hbc/audit.rb
@@ -53,21 +53,33 @@ module Hbc
def check_single_pre_postflight
odebug "Auditing preflight and postflight stanzas"
- add_warning "only a single preflight stanza is allowed" if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PreflightBlock) && k.directives.key?(:preflight) } > 1
+ if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PreflightBlock) && k.directives.key?(:preflight) } > 1
+ add_warning "only a single preflight stanza is allowed"
+ end
- add_warning "only a single postflight stanza is allowed" if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PostflightBlock) && k.directives.key?(:postflight) } > 1
+ if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PostflightBlock) && k.directives.key?(:postflight) } > 1
+ add_warning "only a single postflight stanza is allowed"
+ end
end
def check_single_uninstall_zap
odebug "Auditing single uninstall_* and zap stanzas"
- add_warning "only a single uninstall stanza is allowed" if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::Uninstall) } > 1
+ if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::Uninstall) } > 1
+ add_warning "only a single uninstall stanza is allowed"
+ end
- add_warning "only a single uninstall_preflight stanza is allowed" if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PreflightBlock) && k.directives.key?(:uninstall_preflight) } > 1
+ if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PreflightBlock) && k.directives.key?(:uninstall_preflight) } > 1
+ add_warning "only a single uninstall_preflight stanza is allowed"
+ end
- add_warning "only a single uninstall_postflight stanza is allowed" if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PostflightBlock) && k.directives.key?(:uninstall_postflight) } > 1
+ if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::PostflightBlock) && k.directives.key?(:uninstall_postflight) } > 1
+ add_warning "only a single uninstall_postflight stanza is allowed"
+ end
- add_warning "only a single zap stanza is allowed" if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::Zap) } > 1
+ if cask.artifacts.count { |k| k.is_a?(Hbc::Artifact::Zap) } > 1
+ add_warning "only a single zap stanza is allowed"
+ end
end
def check_required_stanzas