module Hirb module Util extend self # Returns a constant like const_get() no matter what namespace it's nested in. # Returns nil if the constant is not found. def any_const_get(name) return name if name.is_a?(Module) begin klass = Object name.split('::').each {|e| klass = klass.const_get(e) } klass rescue nil end end end end