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:
parent
289787aba2
commit
c1ae23dd00
3 changed files with 8 additions and 14 deletions
|
@ -25,12 +25,10 @@ module VagrantHelpers
|
|||
end
|
||||
|
||||
def run_vagrant_command(command)
|
||||
if (status = vagrant_cli_command("ssh -c #{command.inspect}")).success?
|
||||
true
|
||||
else
|
||||
status = vagrant_cli_command("ssh -c #{command.inspect}")
|
||||
return true if status.success?
|
||||
raise VagrantSSHCommandError, status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
World(VagrantHelpers)
|
||||
|
|
|
@ -91,11 +91,10 @@ module Capistrano
|
|||
end
|
||||
|
||||
def assert_value_or_block_not_both(value, block)
|
||||
unless value.nil? || block.nil?
|
||||
return if value.nil? || block.nil?
|
||||
raise Capistrano::ValidationError,
|
||||
"Value and block both passed to Configuration#set"
|
||||
end
|
||||
end
|
||||
|
||||
class ValidatedQuestion < Question
|
||||
def initialize(validator)
|
||||
|
|
|
@ -5,12 +5,9 @@ module Capistrano
|
|||
end
|
||||
|
||||
def verify
|
||||
if match?
|
||||
self
|
||||
else
|
||||
return self if match?
|
||||
raise "Capfile locked at #{version}, but #{current_version} is loaded"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
|
Loading…
Reference in a new issue