From: Sam Duncan Date: 2011-06-24T07:20:27+09:00 Subject: Re: RFC - One word alias for require_relative On 24/06/11 09:59, Ilias Lazaridis wrote: > Combined with the suggested term "require!", and extending the > functionality even more, the result would be this one: > > module Kernel > def require!(*libs) > > libs.each do |lib| > begin > require_relative(lib) > rescue LoadError > require lib > end > end > > end > end > > #original > require_relative 'lib/baselib' > require 'sinatra"' > > #new > require! 'lib/baselib', 'sinatra' > Presumably you would then have to be careful not to have something called sinatra.rb nearby to avoid unexpected side effects. Merging the two flavours of require might not be a good idea for that reason. It also makes it a bit ambiguous for people reading your code as to where the require is /supposed/ to be coming from. ... unless I'm missing something obvious.