[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[Q] In place edit mode activation?

Laurent Julliard

7/9/2008 9:33:00 PM

Hello,

Does anybody knows if there is a way to activate the 'in place edit
mode' from within a Ruby script that would have the same effect as using
the -i option on the command line?

Thanks

Laurent

1 Answer

Joel VanderWerf

7/10/2008 5:59:00 AM

0

Laurent Julliard wrote:
> Hello,
>
> Does anybody knows if there is a way to activate the 'in place edit
> mode' from within a Ruby script that would have the same effect as using
> the -i option on the command line?

Use $-i="" :

[~/tmp] cat >foo
foo
[~/tmp] cat dash-i.rb
$-i=""
[~/tmp] ruby -r dash-i -p -e '$_.upcase!' foo
[~/tmp] cat foo
FOO

HTH

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407