Cannot customize irb initialization


#1

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


#2

Fredrik wrote:

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

?


#3

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.


#4

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!


#5

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?


#6

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