summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-09-08 09:17:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-09-08 09:17:55 +0000
commitb0e1436164e4004f048bac4babc220e0deccb4f9 (patch)
tree1e46ec5aa4b12c076ba9c535ff889a49b9a7b3c1 /lib
parent48acbc5e03622f1eb0423a6c2a3a603f61acfac6 (diff)
1.1c5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/ftools.rb2
-rw-r--r--lib/jcode.rb10
-rw-r--r--lib/mkmf.rb23
3 files changed, 26 insertions, 9 deletions
diff --git a/lib/ftools.rb b/lib/ftools.rb
index 59bc81b365..ff487dc808 100644
--- a/lib/ftools.rb
+++ b/lib/ftools.rb
@@ -151,7 +151,7 @@ class << File
o_chmod mode, *files
end
- def install(from, to, mode, verbose)
+ def install(from, to, mode = nil, verbose = false)
to = catname(from, to)
unless FileTest.exist? to and cmp from, to
cp from, to, verbose
diff --git a/lib/jcode.rb b/lib/jcode.rb
index 6d71518c70..50b7beee9d 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -104,7 +104,7 @@ class String
end
def tr(from, to)
- self.dup.tr!(from, to)
+ (str = self.dup).tr!(from, to) or str
end
def delete!(del)
@@ -127,7 +127,7 @@ class String
end
def delete(del)
- self.dup.delete!(del)
+ (str = self.dup).delete!(del) or str
end
def squeeze!(del=nil)
@@ -155,7 +155,7 @@ class String
end
def squeeze(del=nil)
- self.dup.squeeze!(del)
+ (str = self.dup).squeeze!(del) or str
end
def tr_s!(from, to)
@@ -188,7 +188,7 @@ class String
end
def tr_s(from, to)
- self.dup.tr_s!(from,to)
+ (str = self.dup).tr_s!(from,to) or str
end
alias original_chop! chop!
@@ -202,7 +202,7 @@ class String
end
def chop
- self.dup.chop!
+ (str = self.dup).chop! or str
end
end
$VERBOSE = $vsave
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index e89ac7d507..21476cbd33 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2,6 +2,7 @@
# invoke like: ruby -r mkmf extconf.rb
require 'rbconfig'
+require 'find'
include Config
@@ -83,6 +84,24 @@ def try_cpp
xsystem(format(CPP, $CFLAGS))
end
+def install_rb(mfile)
+ path = []
+ dir = []
+ Find.find("lib") do |f|
+ next unless /\.rb$/ =~ f
+ f = f[4..-1]
+ path.push f
+ dir |= File.dirname(f)
+ end
+ for f in dir
+ next if f == "."
+ mfile.printf "\t@test -d $(libdir)/%s || mkdir $(libdir)/%s\n", f, f
+ end
+ for f in path
+ mfile.printf "\t$(INSTALL_DATA) %s $(libdir)/%s\n", f, f
+ end
+end
+
def have_library(lib, func)
printf "checking for %s() in -l%s... ", func, lib
STDOUT.flush
@@ -299,9 +318,7 @@ $(libdir)/$(TARGET): $(TARGET)
@test -d $(libdir) || mkdir $(libdir)
$(INSTALL) $(TARGET) $(libdir)/$(TARGET)
EOMF
- for rb in Dir["lib/*.rb"]
- mfile.printf "\t$(INSTALL_DATA) %s %s\n", rb, $libdir
- end
+ install_rb(mfile)
mfile.printf "\n"
if CONFIG["DLEXT"] != "o"