3 ms·
The system you use to manage your $LOAD_PATH is not my library / app / tests concern. Whether rubygems is used or not is an environment issue. My library or ap
by patio11 17y ago
The system you use to manage your $LOAD_PATH is not my library / app / tests concern. Whether rubygems is used or not is an environment issue. My library or app should have no say in the matter. Explicitly requiring me to not use rubygems is either not necessary or misguided.
When you feel the urge to strike "require 'rubygems'" because some shit isn’t working, stop and consider whether one of these solutions is more appropriate:
1) An empty rubygems.rb in your $LOAD_PATH should do the trick.
2) Redefine Kernel#require to intercept calls to load rubygems and silently discard them.
Why You Shouldn't Force Non-Rubygems On People
When I write you a library, appplication, or tests, I may not want to have to care how you execute my program. When you require that I not include 'rubygems' in my code, you remove my ability to make that decision. I cannot anticipate all of your requirements in advance, but you can set up your environment properly such that the defaults I choose are overridden.
- masklinn 17y agoSo instead of separating the library and the environment you suggest that ugly hacks are more appropriate? Really?
- tptacek 17y agoHaving the 99.9% of ruby users who don't have a religious problem with rubygems all specify rubygems on the commandline seems like a more ugly hack than having the 3 developers in the world who care about this problem alter their environment.
- extension 17y agoYou underestimate the amount of discontent with rubygems. There is at least one replacement available (hellorip.com) and for good reason. I've already come across a few libs that use it exclusively. Ruby 1.9 actually ignores "require 'rubygems'" entirely which I suppose will make this whole issue moot, as soon as we all start using it.. um, any day now.