summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-18 17:43:20 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-18 17:43:20 +0000
commit359702f04db21aeb28aa11ebaa291703a75d6524 (patch)
treea73b5cd6acc380b4dac6857181efbbab20f5bd2d
parente2e96dde0375ed0c3ef20ed3457824d8a54c1d38 (diff)
* bin/irb: Moved from sample/irb.rb.
* instruby.rb: Install script files under bin/ with ruby's program prefix and suffix. * instruby.rb: Rewrite installed scripts' shebang lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@3058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--MANIFEST2
-rw-r--r--instruby.rb19
-rw-r--r--sample/irb.rb21
4 files changed, 28 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 29ff279a87..c42b75e258 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Tue Nov 19 02:34:18 2002 Akinori MUSHA <knu@iDaemons.org>
+
+ * bin/irb: Moved from sample/irb.rb.
+
+ * instruby.rb: Install script files under bin/ with ruby's program
+ prefix and suffix.
+
+ * instruby.rb: Rewrite installed scripts' shebang lines.
+
Mon Nov 18 02:59:31 2002 Akinori MUSHA <knu@iDaemons.org>
* lib/tempfile.rb: Make this libary thread safe.
diff --git a/MANIFEST b/MANIFEST
index 8a7d6fce0b..3c57e578fa 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -74,6 +74,7 @@ util.c
variable.c
version.c
version.h
+bin/irb
djgpp/README.djgpp
djgpp/config.hin
djgpp/config.sed
@@ -249,7 +250,6 @@ sample/from.rb
sample/fullpath.rb
sample/getopts.test
sample/goodfriday.rb
-sample/irb.rb
sample/less.rb
sample/list.rb
sample/list2.rb
diff --git a/instruby.rb b/instruby.rb
index 7818455dec..e3b08ffdee 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -76,7 +76,24 @@ else
end
Dir.chdir CONFIG["srcdir"]
-File.install "sample/irb.rb", "#{bindir}/irb", 0755, true
+for src in Dir["bin/*"]
+ next unless File.file?(src)
+
+ name = ruby_install_name.sub(/ruby/, File.basename(src))
+ dest = File.join(bindir, name)
+
+ File.install src, dest, 0755, true
+
+ open(dest, "r+") { |f|
+ shebang = f.gets
+ body = f.readlines
+
+ f.rewind
+
+ f.print shebang.sub(/ruby/, ruby_install_name), *body
+ f.truncate(f.pos)
+ }
+end
Find.find("lib") do |f|
next unless /\.rb$/ =~ f || /help-message$/ =~ f
diff --git a/sample/irb.rb b/sample/irb.rb
deleted file mode 100644
index 58f3699139..0000000000
--- a/sample/irb.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env ruby
-#
-# irb.rb - intaractive ruby
-# $Release Version: 0.7.3 $
-# $Revision$
-# $Date$
-# by Keiju ISHITSUKA(keiju@ishitsuka.com)
-#
-
-require "irb"
-
-if __FILE__ == $0
- IRB.start(__FILE__)
-else
- # check -e option
- if /^-e$/ =~ $0
- IRB.start(__FILE__)
- else
- IRB.initialize(__FILE__)
- end
-end