I've changed `const_get` in Ruby 2.0. If it were implemented in 1.9, it
would look roughly like this:
def const_get name, inherited = true
name.to_s.split('::').inject(self.class) do |klass, name|
klass.const_get name, inherited
I was hoping we could use this to replace the implementation of
`constantize`, but it seems we have an inconsistency in the way that
`constantize` works in regard to constant inheritance.
I've written a test to demonstrate the problem:
For some reason `constantize` inherits constants, but not when the
constant is defined on Object, where `const_get` in Ruby 2.0 will always
honor the inheritance (even if the constant is defined at the top).
Is there any chance we can change this?