Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#5028

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.

Reported by Norman Clarke · July 1st, 2010 @ 03:10 PM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Norman Clarke
    Norman Clarke
    • Tag changed from activesupport, docs, multibyte to activesupport, docs, multibyte, patch

    Patch attached. Sorry for the extra-bold OMG SLICE!!!!! line above, not sure why that happened. :)

    July 1st, 2010 @ 03:12 PM

  2. Santiago Pastorino
    Santiago Pastorino
    • Assigned user set to José Valim
    • Milestone cleared.
    • State changed from new to open
    • Importance changed from to Low

    July 7th, 2010 @ 05:07 PM

  3. José Valim
    José Valim

    I cannot apply this patch anymore because the guide change. I would recommend you to fork github.com/lifo/docrails.git and do your docs change there (everyone has commit access) and provide the code change in one patch. :)

    July 8th, 2010 @ 09:28 PM

  4. Norman Clarke
    Norman Clarke

    No problem. Here's the commit without the doc updates, and rebased against the current master.

    July 8th, 2010 @ 09:45 PM

  5. Repository
  6. Jeremy Kemper