aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/ri/writer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/ri/writer.rb')
-rw-r--r--lib/rdoc/ri/writer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rdoc/ri/writer.rb b/lib/rdoc/ri/writer.rb
index 2d14942bdd..92aaa1c2da 100644
--- a/lib/rdoc/ri/writer.rb
+++ b/lib/rdoc/ri/writer.rb
@@ -12,7 +12,11 @@ class RDoc::RI::Writer
# form (where punctuation is replaced by %xx)
def self.internal_to_external(name)
- name.gsub(/\W/) { "%%%02x" % $&[0].ord }
+ if ''.respond_to? :ord then
+ name.gsub(/\W/) { "%%%02x" % $&[0].ord }
+ else
+ name.gsub(/\W/) { "%%%02x" % $&[0] }
+ end
end
##