lib/net/ssh/session_helpers.rb in net-ssh-session-0.1.0 vs lib/net/ssh/session_helpers.rb in net-ssh-session-0.1.1
- old
+ new
@@ -1,9 +1,17 @@
require 'timeout'
module Net
module SSH
module SessionHelpers
+ # Execute command with sudo
+ # @param [String] command string
+ # @param [Hash] execution options
+ # @return [SessionCommand]
+ def sudo(command, options={})
+ run("sudo #{command}", options)
+ end
+
# Swith current directory
# @param path [String] directory path
# @return [Boolean] execution result
def chdir(path)
run("cd #{path}").success?
\ No newline at end of file