This project is archived and is in readonly mode.
constantize now less robust in 2.3.3
-
CancelProfileIsBroken
- Tag changed from 2.3.3, constantize to 2.3.3, bugmash, constantize
-
Ryan Bigg
Here's a patch that proves that it is broken.
-
Michael Koziarski
- State changed from new to wontfix
This appears to be 'just how it is' with ruby unfortunately:
>> Gamma.const_get("Beta") => Alpha::Beta >> Gamma.const_defined?("Beta") => falseWe check const_defined? before calling const_get and ruby returns false here. This is a ruby bug / feature and should probably be fixed upstream.
If you get a work around from upstream, we'd be happy to use it here.
-
CancelProfileIsBroken
- Tag changed from 2.3.3, bugmash, constantize to 2.3.3, constantize
-
Akira Matsuda
@nzkoz
Indeed, it's already fixed in Ruby 1.9
% cat const_defined.rb class Alpha class Beta; end end class Gamma < Alpha end puts Gamma::const_get('Alpha') puts Gamma::const_defined?('Alpha')% ruby18 const_defined.rb Alpha false % ruby19 const_defined.rb Alpha trueI'm gonna ask Ruby 1.8.x maintainers whether this could be backported to 1.8 on not.
-
Michael Koziarski
Sounds good Akira.
