I've written a function for deprec to add/remove entries from users
crontabs.
It needs sudo in order to grab the contents of other users crontabs
using 'capture'.
I've created a patch to allow this. Does this look OK to be checked in?
Should we be using the send method in functions rather than calling
'put' or 'sudo' ?
Alternatively should we make these sorts of functions
accept :sudo=true/false as an
option so we can control it on a call by call basis?
- Mike
Index: lib/capistrano/actor.rb
===================================================================
--- lib/capistrano/actor.rb (revision 6149)
+++ lib/capistrano/actor.rb (working copy)
@@ -294,7 +294,7 @@
# task, collects it's stdout into a string, and returns the
string.
def capture(command, options={})
output = ""
- run(command, options.merge(:once => true)) do |ch, stream, data|
+ send(run_method, command, options.merge(:once => true)) do |
ch, stream, data|
case stream
when :out then output << data
when :err then raise "error processing #{command.inspect}: #
{data.inspect}"
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---