Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shellwords' shelljoin doesn't to_s array elements #2879

Closed
zenspider opened this issue Apr 27, 2015 · 2 comments
Closed

shellwords' shelljoin doesn't to_s array elements #2879

zenspider opened this issue Apr 27, 2015 · 2 comments

Comments

@zenspider
Copy link

Via minitest/minitest-bisect#4

% ruby -v -rshellwords -e 'p [1].shelljoin'
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
"1"

vs

% ruby -v -rshellwords -e 'p [1].shelljoin'
jruby 1.7.9 (1.9.3p392) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-466.1-11M4716 [darwin-x86_64]
NoMethodError: undefined method `empty?' for 1:Fixnum
  shellescape at /Users/ryan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/shellwords.rb:75
    shelljoin at /Users/ryan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/shellwords.rb:111
          map at org/jruby/RubyArray.java:2409
    shelljoin at /Users/ryan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/shellwords.rb:111
    shelljoin at /Users/ryan/.rbenv/versions/jruby-1.7.9/lib/ruby/1.9/shellwords.rb:149
       (root) at -e:1
@zenspider
Copy link
Author

At first glance of master, it looks like this might already be fixed.

@headius
Copy link
Member

headius commented Apr 29, 2015

Looks like this was fixed in stdlib after 1.9.3, and we just ship the exact same shellwords.rb as MRI:

[] ~/projects/jruby $ rvm ruby-1.9 do ruby -v -rshellwords -e 'p [1].shelljoin'
ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-darwin13.3.0]
/Users/headius/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/shellwords.rb:75:in `shellescape': undefined method `empty?' for 1:Fixnum (NoMethodError)
    from /Users/headius/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/shellwords.rb:111:in `block in shelljoin'
    from /Users/headius/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/shellwords.rb:111:in `map'
    from /Users/headius/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/shellwords.rb:111:in `shelljoin'
    from /Users/headius/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/shellwords.rb:149:in `shelljoin'
    from -e:1:in `<main>'

Calling this fixed in 9k.pre1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants