IRB - Switching "comment mode"

Discussion in 'Ruby' started by Marc Heiler, Nov 14, 2006.

  1. Marc Heiler

    Marc Heiler Guest

    Hi,
    I've been trying to solve this thing on my TODO list for some time
    (ok, it's just on my list, and not of highest priority ;-)), and
    finally thought I'd post here.

    In IRB, I would like to be able to apply a filter
    when something is input to IRB (normally, copy pasted
    in my example).
    For example, I'd like to filter all lines that start
    with a '#', and gsub this with '' so that
    comments are evaluated instead.
    Right now, when i copy/paste, i remove leading #'s
    manually. Right now i'd picture using a little method
    that switches between my "comment mode"s.

    Now, making such a Regex is trivial. But how could I
    apply a filter on IRB? I'd not mind to hack
    up my irb but I dont even really figure out how IRB
    gets all its things done. (That way I could apply a method
    before that input, and depending on a global flag/var,
    filter, or not filter that input)

    --
    Posted via http://www.ruby-forum.com/.
    Marc Heiler, Nov 14, 2006
    #1
    1. Advertising

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. MSNews

    Switching JITs

    MSNews, Jun 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    433
    Richard Grimes [MVP]
    Jun 30, 2004
  2. Abdul K Shaik

    DDR/SDR-SDRAM Bank Switching Doubt

    Abdul K Shaik, Aug 9, 2003, in forum: VHDL
    Replies:
    1
    Views:
    2,237
    David Jones
    Aug 9, 2003
  3. Sam Stephenson
    Replies:
    1
    Views:
    223
    Andrew Walrond
    Jun 18, 2005
  4. Replies:
    1
    Views:
    156
    Florian GroƟ
    Oct 26, 2005
  5. anne001
    Replies:
    1
    Views:
    265
    anne001
    Jun 27, 2006
Loading...

Share This Page