[Q] In place edit mode activation?

Discussion in 'Ruby' started by Laurent Julliard, Jul 9, 2008.

  1. 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
     
    Laurent Julliard, Jul 9, 2008
    #1
    1. Advertisements

  2. 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
     
    Joel VanderWerf, Jul 10, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marine
    Replies:
    3
    Views:
    24,861
    Marine
    Feb 15, 2006
  2. dba56
    Replies:
    0
    Views:
    674
    dba56
    Jul 7, 2006
  3. John J Lee
    Replies:
    3
    Views:
    817
    bruno at modulix
    Dec 1, 2005
  4. Edward Loper

    mmm-mode, python-mode and doctest-mode?

    Edward Loper, Aug 9, 2007, in forum: Python
    Replies:
    0
    Views:
    653
    Edward Loper
    Aug 9, 2007
  5. Frank Kurka
    Replies:
    8
    Views:
    635
  6. Jaime Stuardo

    GridView control enters edit mode when I click Edit link twice

    Jaime Stuardo, Apr 7, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    670
    Jaime Stuardo
    Apr 7, 2006
  7. jobs at webdos
    Replies:
    0
    Views:
    811
    jobs at webdos
    Oct 9, 2006
  8. Randy Harris

    IN PLACE edit syntax help needed

    Randy Harris, Feb 23, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    190
    Joe Smith
    Feb 25, 2004
Loading...