From: Tony Arcieri Date: 2010-10-19T01:53:27+09:00 Subject: Re: su {block of code.} --001485f1e440b388fe0492e703d0 Content-Type: text/plain; charset=ISO-8859-1 I'd suggest spawning a new Ruby instance which runs under sudo and talking to it with DRb On Mon, Oct 18, 2010 at 10:32 AM, Guido De Rosa wrote: > Hi! > > Scenario: on a Unix-like system I run a ruby program under a > non-privileged user. Occasionally I need to gain root privileges. > > For external commands it's just a matter of installing sudo, editing > /etc/sudoers properly, and going: > > system "sudo command..." > > But what if I want to do the same for a block of code? > > Something like this would be really, really cool: > > include Sudo > su do > # ruby code... > end > > There's a way to get this? A gem? Any idea on how to implement it? > > Thanks, > Guido > > -- > Posted via http://www.ruby-forum.com/. > > -- Tony Arcieri Medioh! A Kudelski Brand --001485f1e440b388fe0492e703d0--