Backtick operator (``) does not work in 1.5.3
---------------------------------------------

                 Key: JRUBY-5133
                 URL: http://jira.codehaus.org/browse/JRUBY-5133
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5.3
         Environment: Windows XP SP3, Java(TM) SE Runtime Environment (build 
1.6.0_21-b07)
            Reporter: Arturas Slajus
            Assignee: Thomas E Enebo
            Priority: Critical


1.5.3 jruby doesn't work with ``, it just returns "".

Test code:
{{puts `c:/ssh/plink.exe`.inspect}}

Results:
{quote}
C:\nebula-web\main>pik use jruby
Select which Ruby you want:
1. 153: jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7) (Java HotSp
ot(TM) Client VM 1.6.0_21) [x86-java]
2. 141: jruby 1.4.1 (ruby 1.8.7 patchlevel 174) (2010-04-26 ea6db6a) (Java HotSp
ot(TM) Client VM 1.6.0_21) [x86-java]
?  1

C:\nebula-web\main>jruby -v
jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7) (Java HotSpot(TM) C
lient VM 1.6.0_21) [x86-java]

C:\nebula-web\main>jruby test.rb
""

C:\nebula-web\main>pik use jruby
Select which Ruby you want:
1. 153: jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7) (Java HotSp
ot(TM) Client VM 1.6.0_21) [x86-java]
2. 141: jruby 1.4.1 (ruby 1.8.7 patchlevel 174) (2010-04-26 ea6db6a) (Java HotSp
ot(TM) Client VM 1.6.0_21) [x86-java]
?  2

C:\nebula-web\main>jruby -v
jruby 1.4.1 (ruby 1.8.7 patchlevel 174) (2010-04-26 ea6db6a) (Java HotSpot(TM) C
lient VM 1.6.0_21) [x86-java]

C:\nebula-web\main>jruby test.rb
"PuTTY Link: command-line connection utility\r\nRelease 0.60\r\nUsage: plink [op
tions] [u...@]host [command]\r\n       (\"host\" can also be a PuTTY saved sessi
on name)\r\nOptions:\r\n  -V        print version information and exit\r\n  -pgp
fp    print PGP key fingerprints and exit\r\n  -v        show verbose messages\r
\n  -load sessname  Load settings from saved session\r\n  -ssh -telnet -rlogin -
raw\r\n            force use of a particular protocol\r\n  -P port   connect to
specified port\r\n  -l user   connect with specified username\r\n  -batch    dis
able all interactive prompts\r\nThe following options only apply to SSH connecti
ons:\r\n  -pw passw login with specified password\r\n  -D [listen-IP:]listen-por
t\r\n            Dynamic SOCKS-based port forwarding\r\n  -L [listen-IP:]listen-
port:host:port\r\n            Forward local port to remote address\r\n  -R [list
en-IP:]listen-port:host:port\r\n            Forward remote port to local address
\r\n  -X -x     enable / disable X11 forwarding\r\n  -A -a     enable / disable
agent forwarding\r\n  -t -T     enable / disable pty allocation\r\n  -1 -2     f
orce use of particular protocol version\r\n  -4 -6     force use of IPv4 or IPv6
\r\n  -C        enable compression\r\n  -i key    private key file for authentic
ation\r\n  -noagent  disable use of Pageant\r\n  -agent    enable use of Pageant
\r\n  -m file   read remote command(s) from file\r\n  -s        remote command i
s an SSH subsystem (SSH-2 only)\r\n  -N        don't start a shell/command (SSH-
2 only)\r\n  -nc host:port\r\n            open tunnel in place of session (SSH-2
 only)\r\n"
{quote}

Strangely enough jruby 1.5.3 can call itself:
{quote}
C:\nebula-web\main>jirb
irb(main):001:0> `jruby -v`
=> "jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7) (Java HotSpot(T
M) Client VM 1.6.0_21) [x86-java]\n"
{quote}

However `` works fine on Ubuntu:
{quote}
artu...@arturaz-fujitsu:~/Software/jruby-1.5.3/bin$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)
artu...@arturaz-fujitsu:~/Software/jruby-1.5.3/bin$ jirb
irb(main):001:0> `ssh -v`
OpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-w local_tun[:remote_tun]] [u...@]hostname [command]
=> ""
irb(main):002:0> `echo aa`
=> "aa\n"
{quote}

This behaviour breaks bundler gem, because it depends on invoking commands via 
``.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to