1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Fix guard-clause warnings reported by RuboCop 0.43

This commit is contained in:
Matt Brictson 2016-09-19 09:59:57 -07:00
parent 289787aba2
commit c1ae23dd00
No known key found for this signature in database
GPG key ID: 2F279EAD1F2ACFAF
3 changed files with 8 additions and 14 deletions

View file

@ -25,11 +25,9 @@ module VagrantHelpers
end end
def run_vagrant_command(command) def run_vagrant_command(command)
if (status = vagrant_cli_command("ssh -c #{command.inspect}")).success? status = vagrant_cli_command("ssh -c #{command.inspect}")
true return true if status.success?
else raise VagrantSSHCommandError, status
raise VagrantSSHCommandError, status
end
end end
end end

View file

@ -91,10 +91,9 @@ module Capistrano
end end
def assert_value_or_block_not_both(value, block) def assert_value_or_block_not_both(value, block)
unless value.nil? || block.nil? return if value.nil? || block.nil?
raise Capistrano::ValidationError, raise Capistrano::ValidationError,
"Value and block both passed to Configuration#set" "Value and block both passed to Configuration#set"
end
end end
class ValidatedQuestion < Question class ValidatedQuestion < Question

View file

@ -5,11 +5,8 @@ module Capistrano
end end
def verify def verify
if match? return self if match?
self raise "Capfile locked at #{version}, but #{current_version} is loaded"
else
raise "Capfile locked at #{version}, but #{current_version} is loaded"
end
end end
private private