Ripper.slice FrozenError in ruby 2.5
Trying the example from the Ripper.slice documentation:
require 'ripper' p Ripper.slice('def m(a) nil end', 'ident') #=> /opt/ruby/2.5/lib/ruby/2.5.0/ripper/lexer.rb:199:in `concat': can't modify frozen String (FrozenError)
Just needs to change lexer.rb:195 from
buf = '' to
buf = +''
Updated by jeremyevans0 (Jeremy Evans) 4 months ago
- Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.5: REQUIRED, 2.6: DONTNEED, 2.7: DONTNEED
- Status changed from Open to Closed
This is the related commit for backporting: 67bb95936d241bd452f3bcfb76276e0ab61234f0.
Note that Ruby 2.5 will be moving from the normal maintenance phase to the security maintenance phase in about 4 days.