Cleanup whitespace and comments in WinRM command filters

This commit is contained in:
Shawn Neal 2014-04-24 07:49:19 -07:00
parent 702347c47e
commit d5d9918e48
9 changed files with 7 additions and 39 deletions

View File

@ -12,7 +12,7 @@ module VagrantPlugins
"rm",
"test",
"uname",
"which"
"which",
]
# Filter the given Vagrant command to ensure compatibility with Windows

View File

@ -1,10 +1,8 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Handles the special case of determining the guest OS using cat
class Cat
def filter(command)
# cat /etc/release | grep -i OmniOS
# cat /etc/redhat-release
@ -19,9 +17,7 @@ module VagrantPlugins
# grep command
command.start_with?('cat /etc/')
end
end
end
end
end

View File

@ -1,21 +1,17 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Converts a *nix 'chmod' command to a PowerShell equivalent
# Converts a *nix 'chmod' command to a PowerShell equivalent (none)
class Chmod
def filter(command)
# Not support on Windows, the communicator will skip this command
# Not supported on Windows, the communicator should skip this command
''
end
def accept?(command)
command.start_with?('chmod ')
end
end
end
end
end

View File

@ -1,21 +1,17 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Converts a *nix 'chown' command to a PowerShell equivalent
# Converts a *nix 'chown' command to a PowerShell equivalent (none)
class Chown
def filter(command)
# Not support on Windows, the communicator will skip this command
# Not supported on Windows, the communicator should skip this command
''
end
def accept?(command)
command.start_with?('chown ')
end
end
end
end
end

View File

@ -1,8 +1,7 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Converts a *nix 'grep' command to a PowerShell equivalent
# Converts a *nix 'grep' command to a PowerShell equivalent (none)
class Grep
def filter(command)
@ -18,9 +17,7 @@ module VagrantPlugins
def accept?(command)
command.start_with?('grep ')
end
end
end
end
end

View File

@ -1,10 +1,8 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Converts a *nix 'rm' command to a PowerShell equivalent
class Rm
def filter(command)
# rm -Rf /some/dir
# rm /some/dir
@ -20,9 +18,7 @@ module VagrantPlugins
def accept?(command)
command.start_with?('rm ')
end
end
end
end
end

View File

@ -1,10 +1,8 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Converts a *nix 'test' command to a PowerShell equivalent
class Test
def filter(command)
# test -d /tmp/dir
# test -f /tmp/afile
@ -28,7 +26,6 @@ module VagrantPlugins
command.start_with?("test ")
end
private
def check_for_directory(path)
@ -60,9 +57,7 @@ module VagrantPlugins
exit 1
EOH
end
end
end
end
end

View File

@ -1,10 +1,8 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Converts a *nix 'uname' command to a PowerShell equivalent
# Converts a *nix 'uname' command to a PowerShell equivalent (none)
class Uname
def filter(command)
# uname -s | grep 'Darwin'
# uname -s | grep VMkernel
@ -23,9 +21,7 @@ module VagrantPlugins
def accept?(command)
command.start_with?('uname ')
end
end
end
end
end

View File

@ -1,10 +1,8 @@
module VagrantPlugins
module CommunicatorWinRM
module CommandFilters
# Converts a *nix 'which' command to a PowerShell equivalent
class Which
def filter(command)
executable = command.strip.split(/\s+/)[1]
return <<-EOH
@ -18,9 +16,7 @@ module VagrantPlugins
def accept?(command)
command.start_with?('which ')
end
end
end
end
end