[#32676] VC++ embedded rubygems gives NoMethodError undefined method `synchronize' for Mutex — Phlip <phlip2005@...>
[I will try Bill Kelly's PDB path advice presently; this issue is more
5 messages
2010/10/03
[#32687] Re: VC++ embedded rubygems gives NoMethodError undefined method `synchronize' for Mutex
— Roger Pack <rogerdpack2@...>
2010/10/04
> This one's about...
[#32703] Re: VC++ embedded rubygems gives NoMethodError undefined method `synchronize' for Mutex
— Phlip <phlip2005@...>
2010/10/05
> > #<NoMethodError: undefined method `synchronize' for #<Mutex:0x750faa8>>
[#32698] [Ruby 1.9-Feature#3908][Open] private constant — Yusuke Endoh <redmine@...>
Feature #3908: private constant
10 messages
2010/10/05
[#32795] Call for Cooperation: CFUNC usage survey — SASADA Koichi <ko1@...>
Hi,
5 messages
2010/10/15
[#32814] WeakHash — Santiago Pastorino <santiago@...>
Hi guys,
6 messages
2010/10/15
[#32844] [Ruby 1.9-Feature#3963][Open] Map class in standard library — Thomas Sawyer <redmine@...>
Feature #3963: Map class in standard library
3 messages
2010/10/18
[#32864] [Ruby 1.9-Bug#3972][Open] r28668 breaks test/unit when combined with the testing rake task — Aaron Patterson <redmine@...>
Bug #3972: r28668 breaks test/unit when combined with the testing rake task
6 messages
2010/10/20
[#32932] Behavior of initialize in 1.9 — Aaron Patterson <aaron@...>
The behavior of initialize in 1.9 seems to have changed. Here is an irb
5 messages
2010/10/28
[#32960] [Ruby 1.9-Bug#4005][Open] YAML fails to roundtrip Time objects — Peter Weldon <redmine@...>
Bug #4005: YAML fails to roundtrip Time objects
6 messages
2010/10/29
[#32976] Improve MinGW builds for Ruby 1.8.7, 1.9.2 and 1.9.3 — Luis Lavena <luislavena@...>
Hello,
10 messages
2010/10/30
[#32978] Re: Improve MinGW builds for Ruby 1.8.7, 1.9.2 and 1.9.3
— Aaron Patterson <aaron@...>
2010/10/30
On Sun, Oct 31, 2010 at 03:42:02AM +0900, Luis Lavena wrote:
[ruby-core:32675] Re: warning: toplevel constant XX referenced by YY::XX
From:
Steven Parkes <smparkes@...>
Date:
2010-10-02 22:21:21 UTC
List:
ruby-core #32675
This is a huge blast from the past (c.f. http://bit.ly/9VSaM7).
I'm wondering if we could make this into a hard (i.e., call const_missing) error rather than the hard-printed/otherwise undetectable warning it is right now?
This is kicking my butt in Rails right now. Basically, if a top level constant (probably any constant found in the lookup chain) is created that aliases a nested class/module that Rails wants to autoload using its const_missing callback, you get the warning message and Rails never gets a const_missing call (and you get the global constant, which isn't what's desired).
(I think) I'd argue that the current behavior is scary given that the introduction of a new constant at the root level can change the behavior of existing explicitly namespaced code. Granted, I think this is only if you do const_missing-based loading.
I don't know if much existing code relies on this? If there's code that does, the workaround seems fairly simple, by defining a constant at the scoped level that points to the value at the other level (though that might have const_missing/autoload ramifications ...)
I haven't really found a workaround for the other way around since the current behavior isn't catchable. I actually hacked my code to define a function of the same name as the constant. The function looks in constants to determine if the nested constant is loaded. Then I use Foo.Bar in client code in place of Foo::Bar where the reference is needed. Yuck.
The seemingly trivial (but not expert) patch is to change
if (value == Qundef) {
to
if (value == Qundef ||
(exclude && tmp == rb_cObject && klass != rb_cObject)) {
in rb_const_get_0, along with removing the next conditional which is now dead.
I'd use autoload to work around this, but that's kicking my butt, too. There doesn't seem any way to reset the autoload state of a symbol/file? (I think) Rails unloads both the autoload caller/container and target, but then there doesn't seem anyway to get ruby to reengage autoload for that symbol/file again? Rails reloads the container which has the autoload calls in it and autoload gets called again, but those will never fire again (even though the symbol referenced doesn't exist).