Issue Details (XML | Word | Printable)

Key: JRUBY-1329
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Charles Oliver Nutter
Reporter: Bryan Weber
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

Incorrect handling of parenthesis with -e switch

Created: 07/Sep/07 07:52 AM   Updated: 10/Sep/08 06:45 PM
Component/s: None
Affects Version/s: JRuby 1.0.1
Fix Version/s: None

Time Tracking:
Not Specified

Environment: Windows Vista


 Description  « Hide
With Ruby this works fine, but with JRuby 1.0.1 I get an error using the -e switch and parenthesis. (Note: this is the command generated by IntelliJ IDEA to execute Ruby/JRuby so it would be good to get it working Version information is included below as well.

RUBY

C:\Users\bweber\Documents>ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV
.shift) C:/Users/bweber/IdeaProjects/test_jruby/ruby/test/test.rb
hello

JRUBY

C:\Users\bweber\Documents>jruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARG
V.shift) C:/Users/bweber/IdeaProjects/test_jruby/ruby/test/test.rb
) was unexpected at this time.

JRUBY VERSION

C:\Users\bweber\Documents>jruby -v
ruby 1.8.5 (2007-08-23 rev 4201) [x86-jruby1.0.1]

The following example does NOT work with JRuby 1.0.1 as well:
jruby -e puts("Hello")



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Bryan Weber added a comment - 07/Sep/07 07:57 AM
Ignore the last part about:

jruby -e puts("hello")

as that doesn't work in Ruby either.


Charles Oliver Nutter added a comment - 19/Oct/07 09:45 PM
This is going to be related to our bat/cmd scripts, and we're pretty poor bat/cmd scripters. If there's any way to get some help on this, we'd appreciate it, since it probably won't get fixed otherwise.

I would strongly recommend that IntelliJ encapsulate the string in quotes; omitting quotes is definitely uncommon and I'm not surprised it doesn't work in JRuby. It would also typically fail if the "ruby" executable is a wrapper script, as it sometimes can be.


Charles Oliver Nutter added a comment - 12/May/08 03:25 PM
I think this is going to have to be a wontfix, since it's terribly involved to get the bat/sh scripts working with a bunch of bare Ruby code. I can't imagine this is a recommended way to use -e, since even MRI will blow up if you have certain characters in a bar chunk of code, like & and such. Workaround is to always enclose the -e code string in quotes.