On Jun 7, 2011, at 17:33 , Yukihiro Matsumoto wrote:

> Hi,
>=20
> In message "Re: [ruby-core:36811] Re: [Ruby 1.9 - Feature #4840][Open] =
Allow returning from require"
>    on Tue, 7 Jun 2011 19:10:15 +0900, Yusuke ENDOH <mame / tsg.ne.jp> =
writes:
>=20
> |Agreed.
>=20
> Ah, I understand the request.  But returning from outside of a method
> makes me so weird.

How about raising a specific exception that is rescued by #require =
instead?

class AbortRequire < StandardError; end

alias :original_require :require

def require f
  original_require f
rescue AbortRequire
  false
end

def=20

p require 'f' # =3D> false

# f.rb:

raise AbortRequire if defined? GitoriousConfig