On 3/12/07, Matt Mower <> wrote:
> On 11/03/07, Joel VanderWerf <> wrote:
> >
> > irb(main):028:0> IRB.conf[
ROMPT][ IRB.conf[
ROMPT_MODE]
> > ][:RETURN].replace('')
> > irb(main):029:0> 1+2
> >
>
> Is this bound to some specific version of Ruby/IRB because it doesn't seem
> to be working for me either in .irbrc or IRB itself:
>
> >> IRB.conf[
ROMPT][ IRB.conf[
ROMPT_MODE] ][:RETURN].replace( "" )
I put this in my .irbc
module IRB
def self.result_format
conf[

ROMPT][conf[

ROMPT_MODE]][:RETURN]
end
def self.result_format=(str)
result_format.replace(str)
end
def self.show_results
self.result_format = "=> %s\n"
end
def self.hide_results
self.result_format = ''
end
end
rick@frodo:~$ irb
irb(main):001:0> 1+2
=> 3
irb(main):002:0> IRB.result_format
=> "=> %s\n"
irb(main):003:0> IRB.hide_results
irb(main):004:0> 1+2
irb(main):005:0> IRB.show_results
=> "=> %s\n"
irb(main):006:0> 1+2
=> 3
irb(main):007:0>
I'm not sure that I'm in love with my naming, but it does seem to
work.
One thing I just discovered. I've got a few different versions of irb
installed.
If I try to run irb1.8.5 it doesn't seem to find ~/.irbc If I
symlinked ~/.irb1.8.5rc to ~/.irbrc it seemed to work.
YMMV
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
IPMS/USA Region 12 Coordinator
http://ipmsr12.denhaven2.com/
Visit the Project Mercury Wiki Site
http://www.mercuryspacecraft.com/