# In place edit mode activation?

**URL:** <https://www.ruby-forum.com/t/in-place-edit-mode-activation/142633>\
**Category:** Ruby\
**Created:** [July 9, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/in-place-edit-mode-activation/142633 "2008-07-09T23:37:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@Laurent\_J](https://www.ruby-forum.com/u/Laurent_J)\
**Post date:** [July 9, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/in-place-edit-mode-activation/142633/1 "2008-07-09T23:37:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Laurent\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@Laurent\_J](https://www.ruby-forum.com/u/Laurent_J)\
**Post date:** [July 10, 2008, 8:03am UTC](https://www.ruby-forum.com/t/in-place-edit-mode-activation/142633/2 "2008-07-10T08:03:21Z")

</div>

Laurent J. 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
