[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Cannot customize irb initialization

Fredrik

2/19/2009 5:12:00 AM

Why can't I give a configuration file as argument when I run irb? It
seems that looks for conf files in the order:
~/.irbrc
..irbrc
irb.rc
_irbrc
$irbrc

I would however like to have more flexibility than that. I would like
to be able to use a special conf file in whichever directory I am. Is
it only me who wants this flexibility? To me the ability to give a
conf file as argument seems like the most obvious argument to have in
irb.

Best regards,
Fredrik
5 Answers

Joel VanderWerf

2/19/2009 6:33:00 AM

0

Fredrik wrote:
> Why can't I give a configuration file as argument when I run irb? It
> seems that looks for conf files in the order:
> ~/.irbrc
> .irbrc
> irb.rc
> _irbrc
> $irbrc
>
> I would however like to have more flexibility than that. I would like
> to be able to use a special conf file in whichever directory I am. Is
> it only me who wants this flexibility? To me the ability to give a
> conf file as argument seems like the most obvious argument to have in
> irb.

How about

irb -r config.rb

?

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

Fredrik

2/19/2009 7:42:00 AM

0

> How about
>
> irb -r config.rb
>
I tried that but it didn't work. I don't think irb treats the file
given by -r as a configuration. I runs what is written in the file as
if written by the user once irb has started.

Joel VanderWerf

2/19/2009 7:52:00 AM

0

Fredrik wrote:
>> How about
>>
>> irb -r config.rb
>>
> I tried that but it didn't work. I don't think irb treats the file
> given by -r as a configuration. I runs what is written in the file as
> if written by the user once irb has started.

What do you mean by "treats as configuration"? How is the effect of -r
different?

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

Fredrik

2/20/2009 1:47:00 AM

0

> > I tried that but it didn't work. I don't think irb treats

Sorry, I'm crazy. I didn't realize that my config file should be named
config.rb instead of config.rc... What a silly mistake... Not it's all
working great!

Nobuyoshi Nakada

2/20/2009 4:13:00 AM

0

Hi,

At Thu, 19 Feb 2009 15:33:24 +0900,
Joel VanderWerf wrote in [ruby-talk:328701]:
> How about
>
> irb -r config.rb
>
> ?

Yet another way.

IRBRC=config.rb irb

--
Nobu Nakada