* ruby.c (load_file_internal): assumes -x flag if no "ruby" is in

the shebang line.  [ruby-dev:39015]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-08-05 10:19:18 +00:00
parent cb9038cbaf
commit 8bc6c71547
3 changed files with 20 additions and 31 deletions

View file

@ -45,6 +45,18 @@ class TestSystem < Test::Unit::TestCase
assert_equal('', `#{ruby} -x #{tmpfilename}`)
assert_equal('555', `#{ruby} -x #{tmpfilename} -zzz=555`)
tmp = open(tmpfilename, "w")
tmp.print "#! /non/exist\\interpreter?/./to|be:ignored\n";
tmp.print "this is a leading junk\n";
tmp.print "#! /usr/local/bin/ruby -s\n";
tmp.print "print $zzz\n";
tmp.print "__END__\n";
tmp.print "this is a trailing junk\n";
tmp.close
assert_equal('', `#{ruby} #{tmpfilename}`)
assert_equal('555', `#{ruby} #{tmpfilename} -zzz=555`)
tmp = open(tmpfilename, "w")
for i in 1..5
tmp.print i, "\n"