JRuby

Incorrect handling of parenthesis with -e switch

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: JRuby 1.0.1
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows Vista
  • Number of attachments :
    0

Description

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")

Activity

Hide
Bryan Weber added a comment -

Ignore the last part about:

jruby -e puts("hello")

as that doesn't work in Ruby either.

Show
Bryan Weber added a comment - Ignore the last part about: jruby -e puts("hello") as that doesn't work in Ruby either.
Hide
Charles Oliver Nutter added a comment -

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.

Show
Charles Oliver Nutter added a comment - 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.
Hide
Charles Oliver Nutter added a comment -

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.

Show
Charles Oliver Nutter added a comment - 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.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: