Search code examples
rubyjruby

Why do ruby's stack trance contain non matching quotations?


Why are method names in ruby stack trace aren't quoted with matching quotations? For example: `eval'. Opens with a backtick (grave accent) and closes with single quote.

Is there a reason for this?

jruby-9.1.15.0 :009 > test
ArgumentError: wrong number of arguments (0 for 2)
    from (irb):9:in `<eval>'
    from org/jruby/RubyKernel.java:994:in `eval'
    from org/jruby/RubyKernel.java:1292:in `loop'
    from org/jruby/RubyKernel.java:1114:in `catch'

jRuby version 9.1.15.0 (2.3.3)


Solution

  • That's just a quirky Ruby internal, a way of formatting using a plain-ASCII equivalent of proper typographical quotes like ‘this’. The closest you can get to open/close quotes is:

    `this'
    

    It looks ugly, one character is a component of an accent, the other a vertical quote, and I think they should switch the formatting, but that's just me.