diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-12 07:48:31 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-12 07:48:31 +0000 |
commit | 548b5143db2c3d701520671ef1413cf3c39fcedf (patch) | |
tree | f89e9e7746e75343a2886ee50fc23a37f9fe5886 /lib | |
parent | cfdf994071fac150246d54d65a66ddeba4d53a97 (diff) |
2000-06-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/jcode.rb | 16 | ||||
-rw-r--r-- | lib/mkmf.rb | 4 |
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/jcode.rb b/lib/jcode.rb index a7606d04ce..49262857a8 100644 --- a/lib/jcode.rb +++ b/lib/jcode.rb @@ -108,10 +108,6 @@ class String h end - def bsquote(str) - str.gsub(/\\/, '\\\\\\\\') - end - HashCache = {} TrPatternCache = {} DeletePatternCache = {} @@ -122,7 +118,7 @@ class String def tr!(from, to) return self.delete!(from) if to.length == 0 - pattern = TrPatternCache[from] ||= /[#{bsquote(from)}]/ + pattern = TrPatternCache[from] ||= /[#{Regexp::quote(from)}]/ if from[0] == ?^ last = /.$/.match(to)[0] self.gsub!(pattern, last) @@ -137,7 +133,7 @@ class String end def delete!(del) - self.gsub!(DeletePatternCache[del] ||= /[#{bsquote(del)}]+/, '') + self.gsub!(DeletePatternCache[del] ||= /[#{Regexp::quote(del)}]+/, '') end def delete(del) @@ -147,7 +143,7 @@ class String def squeeze!(del=nil) pattern = if del - SqueezePatternCache[del] ||= /([#{bsquote(del)}])\1+/ + SqueezePatternCache[del] ||= /([#{Regexp::quote(del)}])\1+/ else /(.|\n)\1+/ end @@ -161,7 +157,7 @@ class String def tr_s!(from, to) return self.delete!(from) if to.length == 0 - pattern = SqueezePatternCache[from] ||= /([#{bsquote(from)}])\1+"/ #" + pattern = SqueezePatternCache[from] ||= /([#{Regexp::quote(from)}])\1+"/ #" if from[0] == ?^ last = /.$/.match(to)[0] self.gsub!(pattern, last) @@ -194,11 +190,11 @@ class String def each_char if iterator? - scan(/./) do |x| + scan(/./m) do |x| yield x end else - scan(/./) + scan(/./m) end end diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 5dc843f47b..b885690ec5 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -406,10 +406,12 @@ all: $(DLLIB) clean:; @$(RM) *.#{$OBJEXT} *.so *.sl *.a $(DLLIB) @$(RM) $(TARGET).lib $(TARGET).exp $(TARGET).ilk *.pdb + +distclean: clean @$(RM) Makefile extconf.h conftest.* @$(RM) core ruby$(EXEEXT) *~ -realclean: clean +realclean: distclean install: $(archdir)/$(DLLIB) |