summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-26 09:09:41 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-26 09:09:41 +0000
commitfbbd5539ae0959e888b651039ea36caf5e4e061c (patch)
treeb3d63be30753a247585f8dacd12200e1e2cea1ea /lib
parentcdde29b924f3f310382d059938b0c94e209fced7 (diff)
1.1b9_05_pre1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/delegate.rb4
-rw-r--r--lib/jcode.rb10
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 04c824401a..90d1d1abb0 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -1,8 +1,8 @@
# Delegation class that delegates even methods defined in super class,
# which can not be covered with normal method_missing hack.
#
-# Delegater is the abstract delegation class. Need to redefine
-# `__getobj__' method in the subclass. SimpleDelegater is the
+# Delegator is the abstract delegation class. Need to redefine
+# `__getobj__' method in the subclass. SimpleDelegator is the
# concrete subclass for simple delegation.
#
# Usage:
diff --git a/lib/jcode.rb b/lib/jcode.rb
index 34d3ebb453..d7c16a173c 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -11,11 +11,11 @@ class String
alias original_succ succ
private :original_succ
- def mbchar?(c)
+ def mbchar?
if $KCODE =~ /^s/i
- c =~ /[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc]/n
+ self =~ /[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc]/n
elsif $KCODE =~ /^e/i
- c =~ /[\xa1-\xfe][\xa1-\xfe]/n
+ self =~ /[\xa1-\xfe][\xa1-\xfe]/n
else
FALSE
end
@@ -25,7 +25,7 @@ class String
if self[-2] && self[-2] & 0x80 != 0
s = self.dup
s[-1] += 1
- s[-1] += 1 if !mbchar?(s)
+ s[-1] += 1 if !s.mbchar?
return s
else
original_succ
@@ -42,7 +42,7 @@ class String
if self[0..-2] == to[0..-2]
first = self[-2].chr
for c in self[-1] .. to[-1]
- if mbchar?(first+c.chr)
+ if first+c.chr.mbchar?
yield self[0..-2]+c.chr
end
end