Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > IRB - Switching "comment mode"

Thread Tools

IRB - Switching "comment mode"

Marc Heiler
Posts: n/a
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

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Process Switching vs. Fast/CEF Switching? asdf Cisco 7 05-29-2007 05:26 PM
irb require ... where does irb look? what path? anne001 Ruby 1 06-27-2006 12:07 PM
irb question - variable definitions when calling irb from a script problem Ruby 1 10-26-2005 09:13 PM
[ANN] irb-history 1.0.0: Persistent, shared Readline history for IRB Sam Stephenson Ruby 1 06-18-2005 08:56 AM
Complex configuration using Bridge IRB, NAT, VPN, ACL on cisco router(long) Alexandre Cisco 0 10-17-2003 11:03 AM