[MacRuby-devel] [MacRuby] #381: Losing track of a defined constant - possibly related to Module.autoload
MacRuby
ruby-noreply at macosforge.org
Sun Oct 11 00:14:43 PDT 2009
#381: Losing track of a defined constant - possibly related to Module.autoload
-----------------------------------+----------------------------------------
Reporter: kamal.fariz@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: minor | Milestone: MacRuby 0.5
Component: MacRuby | Keywords: autoload require constants
-----------------------------------+----------------------------------------
There seems to be a bug in the interaction of autoload and requires. I
tried hard to reduce this with no success. However, here is the smallest
snippet that will illustrate this bug:
{{{
$ macruby -rubygems -rrack -r"rack/builder" -e "Rack::Builder"
core:in `require:': uninitialized constant Rack::Builder (NameError)
}}}
If you remove the require to "rack/builder", MacRuby will autoload
Rack::Builder normally and no exception will be raised.
{{{
$ macruby -rubygems -rrack -e "Rack::Builder"
}}}
in rack.rb, it defines
{{{
autoload :Builder, "rack/builder"
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/381>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list