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

* (File, Dir).exists? -> (File, Dir).exist? * Prepend unused parameter names with an underscore * Prefer “safe assignment in condition” * Disambiguate splat operators with parens * Remove unnecessary assignments (unused variables) * No longer shadow Vagrant config variable name in Vagrantfile * Removed some trailing whitespace Fixes #1404
23 lines
430 B
Ruby
23 lines
430 B
Ruby
module RemoteCommandHelpers
|
|
def test_dir_exists(path)
|
|
exists?('d', path)
|
|
end
|
|
|
|
def test_symlink_exists(path)
|
|
exists?('L', path)
|
|
end
|
|
|
|
def test_file_exists(path)
|
|
exists?('f', path)
|
|
end
|
|
|
|
def exists?(type, path)
|
|
%{[ -#{type} "#{path}" ]}
|
|
end
|
|
|
|
def safely_remove_file(_path)
|
|
run_vagrant_command("rm #{test_file}") rescue VagrantHelpers::VagrantSSHCommandError
|
|
end
|
|
end
|
|
|
|
World(RemoteCommandHelpers)
|