lib/capissh/invocation.rb
# Returns the command string used by capissh to invoke a comamnd via
# sudo.
#
#   run "#{sudo_command :as => 'bob'} mkdir /path/to/dir"
#
# Also, this method understands a <tt>:sudo</tt> configuration variable,
# which (if specified) will be used as the full path to the sudo
# executable on the remote machine:
#
#   Capissh.new(sudo: "/opt/local/bin/sudo")
#
# If you know what you're doing, you can also set <tt>:sudo_prompt</tt>,
# which tells capissh which prompt sudo should use when asking for
# a password. (This is so that capissh knows what prompt to look for
# in the output.) If you set :sudo_prompt to an empty string, Capissh
# will not send a preferred prompt.
Returns the command string used by capissh to invoke a comamnd via
sudo.

run "#{sudo_command :as => 'bob'} mkdir /path/to/dir"

Also, this method understands a :sudo configuration variable,
which (if specified) will be used as the full path to the sudo
executable on the remote machine.



If you know what you're doing, you can also set :sudo_prompt,
which tells capissh which prompt sudo should use when asking for
a password. (This is so that capissh knows what prompt to look for
in the output.) If you set :sudo_prompt to an empty string, Capissh
will not send a preferred prompt.
Returns the command string used by capissh to invoke a comamnd via sudo . run " # { sudo_command : as = > ' bob ' } mkdir / path / to / dir " Also this method understands a : sudo configuration variable which ( if specified ) will be used as the full path to the sudo executable on the remote machine . If you know what you ' re doing you can also set : sudo_prompt which tells capissh which prompt sudo should use when asking for a password . ( This is so that capissh knows what prompt to look for in the output . ) If you set : sudo_prompt to an empty string Capissh will not send a preferred prompt .
def sudo_command(options={}, &block)
      user = options[:as] && "-u #{options.delete(:as)}"
      sudo_prompt_option = "-p '#{sudo_prompt}'" unless sudo_prompt.empty?
      [configuration.fetch(:sudo, "sudo"), sudo_prompt_option, user].compact.join(" ")
    end
def sudo_command ( options = { } , & block ) user = options [ :as ] && "-u #{options.delete(:as)}" sudo_prompt_option = "-p '#{sudo_prompt}'" unless sudo_prompt . empty? [ configuration . fetch ( :sudo , "sudo" ) , sudo_prompt_option , user ] . compact . join ( " " ) end
Returns the command string used by capissh to invoke a comamnd via
sudo.
Returns the command string used by capissh to invoke a comamnd via sudo .
options
block