The following example fails
class A class B end end p Object.const_get \'A\' # => A p Object.const_get \'A::B\' # => NameError: wrong constant name A::
Extlib provides a full_const_get method, which does just this.
full_const_get
http://github.com/datamapper/extlib/blob/master/lib/extlib/object.rb#L67
You could either include extlib, or copy this implementation and use it yourself (assuming the licensing is compatible with whatever you're using it for)