module CapUtil::Run::InstanceMethods
Public Instance Methods
run(*args, &block)
click to toggle source
# File lib/cap-util/run.rb, line 28 def run(*args, &block) cap.run(*args, &block) end
run_as(user, cmd_str, opts = {}, &block)
click to toggle source
# File lib/cap-util/run.rb, line 36 def run_as(user, cmd_str, opts = {}, &block) as_cmd_str = "su #{user} -lc '#{cmd_str.gsub("'", "\\'")}'" run(as_cmd_str, opts, &block) end
run_as_with_stdin(user, cmd_str, input, opts={})
click to toggle source
# File lib/cap-util/run.rb, line 41 def run_as_with_stdin(user, cmd_str, input, opts={}) run_as(user, cmd_str, opts) {|ch, stream, out| ch.send_data(input + "\n")} end
run_with_stdin(cmd_str, input, opts = {})
click to toggle source
# File lib/cap-util/run.rb, line 32 def run_with_stdin(cmd_str, input, opts = {}) run(cmd_str, opts.merge(:pty => true)) {|ch, stream, out| ch.send_data(input + "\n")} end
sudo(*args, &block)
click to toggle source
# File lib/cap-util/run.rb, line 45 def sudo(*args, &block) cap.sudo(*args, &block) end