summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-12 07:48:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-12 07:48:31 +0000
commit2bc48ec00f2ee0028c1a5096aa676391820b87ec (patch)
treef89e9e7746e75343a2886ee50fc23a37f9fe5886 /lib
parentce6c53d24d361f589169ffa49360e93be8c994a3 (diff)
downloadruby-2bc48ec00f2ee0028c1a5096aa676391820b87ec.tar.gz
ruby-2bc48ec00f2ee0028c1a5096aa676391820b87ec.tar.xz
ruby-2bc48ec00f2ee0028c1a5096aa676391820b87ec.zip
2000-06-12
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/jcode.rb16
-rw-r--r--lib/mkmf.rb4
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/jcode.rb b/lib/jcode.rb
index a7606d04c..49262857a 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 5dc843f47..b885690ec 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)