Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Miscellaneous
-
Labels:None
-
Number of attachments :
Description
IIRC, the "spirit" of jruby -x is to be like perl -x, and be able to do something like this:
#!/bin/sh exec jruby --1.9 -x $0 "$@" #!jruby ...
The "-x" parsing code calls findScript, which looks for the first line containing starting with "#Unable to render embedded object: File (" and >2 characters. Unfortunately, this finds the #) not found./bin/sh line. The code should skip the first line (presumably a #! for another interpreter that will exec jruby -x ...). I'm trying to do this so I can have a command line script that's run with jruby 1.9 (and doesn't require the user to set an environment variable or something; other suggestions welcome).
This is basically how the perl interpreter deals with -x (it actually requires the #! it finds has perl in it somewhere). For example:
0 petef-xps(~) % ./foo.pl a b c
a b c
0 petef-xps(~) % cat foo.pl
#!/bin/sh
exec perl -x $0 "$@"
#!perl
print join(" ", @ARGV), "\n";
That is a secondary intent. JRuby's intent is to be compatible with how MRI behaves. (I'm sure MRI's intent is to behave as perl does.)
Can you show us how JRuby's handling of -x differs from how MRI does? Otherwise, this is not a bug.