Rib and .irbrc files

Hi,

Up till now I've just had a single .irbrc file in one directory (gemplay) which does a require_relative to the individual files in my gem so that when working on the gem I don't have to uninstall and reinstall the gem again with small changes and I've just been running irb from that one directory.

I've recently wanted to be in a position where if I'm in any other directory and start irb I want it to load the gem using require 'gem_name'. I thought I'd be able to achieve that by adding a .irbrc file to my home directory while keeping the old behaviour when starting .irbrc from the (gemplay) directory. I get the opposite behaviour to what I was expecting, and the documentation confirms that my expectations were wrong:

http://ruby-doc.com/docs/ProgrammingRuby/html/irb.html

that the home directory .irbrc file has highest priority and it can't be overridden by the .irbrc file in the working directory.

Is there a clean workaround?, or do I need to do a check in the home directory .irbrc file to see if there is a .irbrc file in the working directory and load that (if that is even possible) and also to check that the working directory is not the home directory.

Thanks
Kevin

Yes, that would be the proper solution IMHO. I checked a shell
function as alternative but could not find a good way to make irb load
a specific file. You may be pull off something by using ruby -r irb
-e 'IRB.start' but that seems overly complicated to me.

Kind regards

robert

ยทยทยท

On Fri, Aug 1, 2014 at 1:32 PM, Kevin Meaney <ktam@yvs.eu.com> wrote:

Is there a clean workaround?, or do I need to do a check in the home directory .irbrc file to see if there is a .irbrc file in the working directory and load that (if that is even possible) and also to check that the working directory is not the home directory.

--
[guy, jim].each {|him| remember.him do |as, often| as.you_can - without end}
http://blog.rubybestpractices.com/