This project is archived and is in readonly mode.

#5028 ✓resolved
Norman Clarke

AS::MB::Chars#slice! doesn't operate in-place; guide docs are out of date

Reported by Norman Clarke | July 1st, 2010 @ 03:10 PM | in 3.0.2

The patch I will attach fixes a few remaining issues with AS::Multibyte::Chars:

  • #slice! was not operating in place
  • On 1.9, #strip!, #lstrip! and #rstrip! were going through the proxy class, but the corresponding bang-less methods were not. The patch avoids defining these methods on 1.9 since they are already multibyte-aware.
  • The Rails initialization guide needed to be updated to reflect recent changes

I also took the opportunity to improve the test setup; I used class_eval to generate single-assertion tests for the bang methods, rather than doing a bunch of assertions in a loop. This makes test failures a little easier to track down.

Edited by Rohit Arondekar for formating.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages