From: "NAKAMURA, Hiroshi" Date: 2007-10-19T18:58:15+09:00 Subject: Re: Import gem to Ruby 1.9 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I think there's a consensus about the need. Nobu's idea is here; (translation of [ruby-dev:31321]) Following is an abstract processes of the current behavior of require; def require_internal(feature) exts = loadable_exts(feature) found = nil $LOAD_PATH.find {|path| found = find_file(path, feature, exts)} or raise LoadError, "no such file to load -- %s", feature load_file(found) end And a proposal is that when a path from $LOAD_PATH is not a String, do the following. path.find_file(feature, exts) found.load_file() Charles Oliver Nutter wrote: >> Thats only one part of the solution though. Everything that wants to >> hook into Kernel#require is still required to alias the existing >> implementation, implement their own Kernel#require as a wrapper. >> >> Have some kind of simple hook infrastructure that Kernel#require used >> would eliminate everyone patching Kernel#require. > > ...and frequently breaking everyone else's hook in the process. Do you have an actual example? RubyGems replaces require and Rails(ActiveSupport) overrides it but they live together. I think Rails took care of rubygems' behavior. Regards, // NaHi -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) iQEVAwUBRxh/mh9L2jg5EEGlAQIPDQgAmJkpc//D6+hei7rlsa1ad30WKomqCX1s yc9zZsLrLUtlFU4HPx70Krrio8x+YLUXYbusqqIvmz/9GfRBQUp6Anmkr7hGlzST Iic5SIIOzbH3soc8ChZ3pqlC+Dzu/Mx3OyKUDKgKeHhaAX8guxbNhq1UEhaHMRqj LDg5XPNNZxazl/mb7ZE8bR1cpwa+FgCRY0JQlQUT0ae/ur9uC0e6ScBL2dZQWSjO MXvSUAMEtEp+XEB31Sbyaz7hqJQ6KfSdbtoGmhOg5ggDYZF30YNSLd/tS6UWGXnM VGqxHGOmsk9wWzsglyuu00OvOZ1G1JeTyc/JNYL7UBHRrDz2/1QcFg== =UGvB -----END PGP SIGNATURE-----