diff options
Diffstat (limited to 'lib/rdoc/code_object/method_attr.rb')
-rw-r--r-- | lib/rdoc/code_object/method_attr.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/rdoc/code_object/method_attr.rb b/lib/rdoc/code_object/method_attr.rb index 27e6599bc1..d7fefa55d4 100644 --- a/lib/rdoc/code_object/method_attr.rb +++ b/lib/rdoc/code_object/method_attr.rb @@ -114,8 +114,8 @@ class RDoc::MethodAttr < RDoc::CodeObject return unless other.respond_to?(:singleton) && other.respond_to?(:name) - [ @singleton ? 0 : 1, name] <=> - [other.singleton ? 0 : 1, other.name] + [@singleton ? 0 : 1, name_codepoint_range, name] <=> + [other.singleton ? 0 : 1, other.name_codepoint_range, other.name] end def == other # :nodoc: @@ -415,4 +415,16 @@ class RDoc::MethodAttr < RDoc::CodeObject end end + def name_codepoint_range # :nodoc: + case name.codepoints[0] + when 0..64 # anything below "A" + 1 + when 91..96 # the symbols between "Z" and "a" + 2 + when 123..126 # 7-bit symbols above "z": "{", "|", "}", "~" + 3 + else # everythig else can be sorted as normal + 4 + end + end end |