1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* instruby.rb: Install batch files on Windows. [Submitted by usa]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@3080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2002-11-22 10:31:03 +00:00
parent 0f547d6bd4
commit e7b328c68c
2 changed files with 25 additions and 4 deletions

View file

@ -1,3 +1,7 @@
Fri Nov 22 19:30:17 2002 Akinori MUSHA <knu@iDaemons.org>
* instruby.rb: Install batch files on Windows. [Submitted by usa]
Thu Nov 21 20:56:35 2002 Minero Aoki <aamine@loveruby.net>
* lib/net/http.rb: should not overwrite Host: header.

View file

@ -86,13 +86,30 @@ for src in Dir["bin/*"]
File.install src, dest, 0755, true
open(dest, "r+") { |f|
shebang = f.gets
body = f.readlines
shebang = f.gets.sub(/ruby/, ruby_install_name)
body = f.read
f.rewind
f.print shebang.sub(/ruby/, ruby_install_name), *body
f.print shebang, body
f.truncate(f.pos)
f.close
if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
open(dest + ".bat", "w") { |b|
b.print <<EOH, shebang, body, <<EOF
@echo off
if "%OS%" == "Windows_NT" goto WinNT
ruby -Sx "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofruby
:WinNT
ruby -Sx "%~nx0" %*
goto endofruby
EOH
__END__
:endofruby
EOF
}
end
}
end