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

format with a single hash passed to it breaks in 1.9 and 2.0 modes #720

Closed
enebo opened this issue May 8, 2013 · 4 comments
Closed

format with a single hash passed to it breaks in 1.9 and 2.0 modes #720

enebo opened this issue May 8, 2013 · 4 comments

Comments

@enebo
Copy link
Member

enebo commented May 8, 2013

options = {:capture=>/\d+/}

p(" with options %p" % options)

We throw an argument error when we should inspect the hash and subst that into the format string.

@gcapizzi
Copy link

Could someone link the RubySpec for this? Can't find it :/

@rtyler
Copy link

rtyler commented Aug 7, 2015

in MRI (2.1) or JRuby 9k the snippet doesn't throw an error

@kares
Copy link
Member

kares commented Apr 8, 2016

marking as JRuby 1.7.x only, present on 1.7.24 :

kares@sputnik:~/workspace/oss/jruby/test$ rvm use 1.7.24
Using /opt/local/rvm/gems/jruby-1.7.24
kares@sputnik:~/workspace/oss/jruby/test$ irb
jruby-1.7.24 :001 > options = {:capture=>/\d+/}
 => {:capture=>/\d+/} 
jruby-1.7.24 :002 > p(" with options %p" % options)
ArgumentError: positional args mixed with named args
    from org/jruby/RubyString.java:1228:in `%'
    from (irb):2:in `evaluate'
    from org/jruby/RubyKernel.java:1079:in `eval'
    from org/jruby/RubyKernel.java:1479:in `loop'
    from org/jruby/RubyKernel.java:1242:in `catch'
    from org/jruby/RubyKernel.java:1242:in `catch'
    from /opt/local/rvm/rubies/jruby-1.7.24/bin/irb:13:in `(root)'
jruby-1.7.24 :003 > 
jruby-1.7.24 :004 >   exit
kares@sputnik:~/workspace/oss/jruby/test$ rvm use 1.9.3
Using /opt/local/rvm/gems/ruby-1.9.3-p551
kares@sputnik:~/workspace/oss/jruby/test$ irb
1.9.3-p551 :001 > options = {:capture=>/\d+/}
 => {:capture=>/\d+/} 
1.9.3-p551 :002 > p(" with options %p" % options)
" with options {:capture=>/\\d+/}"
 => " with options {:capture=>/\\d+/}" 

@enebo enebo added this to the Won't Fix milestone Feb 17, 2017
@enebo
Copy link
Member Author

enebo commented Feb 17, 2017

This works in 9k (recently fixed as another issue in fact) and we will never fix this in 1.7.x as it is winding down....resolving.

@enebo enebo closed this as completed Feb 17, 2017
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

4 participants