Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
shutting irb up
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ara.T.Howard  
View profile  
 More options Mar 2 2007, 3:14 pm
Newsgroups: comp.lang.ruby
From: "Ara.T.Howard" <ara.t.how...@noaa.gov>
Date: Sat, 3 Mar 2007 05:14:04 +0900
Local: Fri, Mar 2 2007 3:14 pm
Subject: shutting irb up

i looked forever, didn't find this, and am posting for posterity

  harp:~ > cat .irbrc
  IRB.conf[:PROMPT][ IRB.conf[:PROMPT_MODE] ][:RETURN]=''

  harp :~ > irb
  irb(main):001:0> 42
  irb(main):002:0> 43
  irb(main):003:0> puts 42
  42
  irb(main):004:0> p 42
  42
  irb(main):005:0> p 'no echo'
  "no echo"
  irb(main):006:0> 'no echo'

-a
--
be kind whenever possible... it is always possible.
- the dalai lama


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Giles Bowkett  
View profile  
 More options Mar 2 2007, 3:16 pm
Newsgroups: comp.lang.ruby
From: "Giles Bowkett" <gil...@gmail.com>
Date: Sat, 3 Mar 2007 05:16:59 +0900
Local: Fri, Mar 2 2007 3:16 pm
Subject: Re: shutting irb up
That's a service to humanity.

On 3/2/07, Ara.T.Howard <ara.t.how...@noaa.gov> wrote:

--
Giles Bowkett
http://www.gilesgoatboy.org
http://gilesbowkett.blogspot.com
http://giles.tumblr.com/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel VanderWerf  
View profile  
 More options Mar 11 2007, 4:24 am
Newsgroups: comp.lang.ruby
From: Joel VanderWerf <vj...@path.berkeley.edu>
Date: Sun, 11 Mar 2007 17:24:21 +0900
Local: Sun, Mar 11 2007 4:24 am
Subject: Re: shutting irb up

You can turn it on and off by destructively modifying the string, this way:

irb(main):027:0> IRB.conf[:PROMPT][ IRB.conf[:PROMPT_MODE] ][:RETURN]
=> "=> %s\n"
irb(main):028:0> IRB.conf[:PROMPT][ IRB.conf[:PROMPT_MODE]
][:RETURN].replace('')
irb(main):029:0> 1+2
irb(main):030:0> IRB.conf[:PROMPT][ IRB.conf[:PROMPT_MODE]
][:RETURN].replace("=> %s\n")
=> "=> %s\n"
irb(main):031:0> 1+2
=> 3

It should be pretty easy to define a function in your .irbrc that wraps
this up nicely....

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick DeNatale  
View profile  
 More options Mar 12 2007, 10:40 am
Newsgroups: comp.lang.ruby
From: "Rick DeNatale" <rick.denat...@gmail.com>
Date: Mon, 12 Mar 2007 23:40:25 +0900
Local: Mon, Mar 12 2007 10:40 am
Subject: Re: shutting irb up
On 3/12/07, Matt Mower <matt.mo...@gmail.com> wrote:

> On 11/03/07, Joel VanderWerf <vj...@path.berkeley.edu> wrote:

> > irb(main):028:0> IRB.conf[:PROMPT][ IRB.conf[:PROMPT_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[:PROMPT][ IRB.conf[:PROMPT_MODE] ][:RETURN].replace( "" )

I put this in my .irbc

module IRB
  def self.result_format
     conf[:PROMPT][conf[:PROMPT_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/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel VanderWerf  
View profile  
 More options Mar 12 2007, 12:54 pm
Newsgroups: comp.lang.ruby
From: Joel VanderWerf <vj...@path.berkeley.edu>
Date: Tue, 13 Mar 2007 01:54:12 +0900
Local: Mon, Mar 12 2007 12:54 pm
Subject: Re: shutting irb up

Works for me with the same irb version as yours, and ruby-1.8.4 and also
ruby-1.8.6-preview3, on ubuntu. Haven't tried 1.8.5 though.

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »