lib/gettext/class_info.rb in gettext-2.0.0 vs lib/gettext/class_info.rb in gettext-2.0.1
- old
+ new
@@ -6,11 +6,11 @@
include Locale::Util::Memoizable
# normalize the klass name
def normalize_class(klass)
ret = (klass.kind_of? Module) ? klass : klass.class
- if ret.name =~ /^\#<|^$/ or ret == GetText
+ if ret.name.to_s =~ /^\#<|^$/ or ret == GetText
ret = Object
end
ret
end
@@ -45,10 +45,13 @@
# Returns the classes which related to klass
# (klass's ancestors, included modules and nested modules)
def related_classes(klass, all_classes = [])
ret = related_classes_internal(klass, all_classes)
- (ret + [Object]).uniq
+ unless ret.include? Object
+ ret += [Object]
+ end
+ ret
end
memoize :related_classes
end
-end
\ No newline at end of file
+end