aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/filters.rb
Commit message (Collapse)AuthorAgeFilesLines
* Frozen truncate (#36109)Jordan Thomas2019-04-261-1/+1
| | | | | | | | | | | | | | * Add test asserting truncate returns unfrozen string * Ensure strings returned from truncate are not frozen This fixes an issue where strings too short to be truncated were returned unfrozen, where as long-enough strings were returned frozen. Now retuned strings will not be frozen whether or not the string returned was shortened. * Update changelog w/ new truncate behavior description [Jordan Thomas + Rafael Mendonça França]
* String#truncate_bytes: limit to N bytes without breaking multibyte charsJeremy Daer2018-02-181-0/+41
| | | | | This faithfully preserves grapheme clusters (characters composed of other characters and combining marks) and other multibyte characters.
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Speedup String#squishojab2015-04-121-2/+1
|
* Merge pull request #19121 from davydovanton/update-doc-for-removeYves Senn2015-02-281-2/+3
|\ | | | | | | Update documentation examples for String#remove [skip ci]
| * Update documentation examples for String#remove [skip ci]Anton Davydov2015-02-281-6/+7
|/
* Fix a backtracking problem in String#truncate_wordsHenrik Nygren2015-02-251-1/+1
| | | | Fixes #19070.
* added example of squish!, remove, test case for multiple occurrence ofRishi Jain2014-11-061-0/+9
| | | | | | | | pattern removal added example for string#remove and test case for remove of multiple occurence of pattern removed extra whitespaces
* Make `String#remove` and `String#remove!` accept multiple argumentsPavel Pravosud2014-10-251-6/+10
|
* As of Unicode 6.3, Mongolian Vowel Separator is not whitespaceMatthew Draper2014-09-151-1/+1
| | | | | Ruby 2.2 knows this, and no longer matches it with [[:space:]], so it's not a good candidate for testing String#squish.
* Merge pull request #16190 from oss92/word_truncationMatthew Draper2014-07-171-0/+24
|\ | | | | | | Word truncation
| * Added truncate_words method to activesupport stringsroot2014-07-161-0/+21
|/
* Typo Fix[ci skip]Rashmi Yadav2013-08-141-3/+3
|
* Add String#remove(pattern) as a short-hand for the common pattern of ↵David Heinemeier Hansson2013-08-131-0/+10
| | | | String#gsub(pattern, '')
* Better not mutate the given options HashAkira Matsuda2013-07-101-3/+3
|
* Speed up String#truncateAkira Matsuda2013-07-101-1/+1
| | | | | | | Benchmark: user system total real old 1.550000 0.040000 1.590000 ( 1.585866) new 1.250000 0.040000 1.290000 ( 1.287693)
* interpolate instead of string concatVipul A M2013-04-151-1/+1
|
* no need for \Z, \z is more conciseXavier Noria2013-01-281-1/+1
|
* Improve String#squish whitespaces matchingAntoine Lyset2013-01-221-2/+5
|
* update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-121-3/+3
|
* remove unnecessary requireSergey Nartimov2012-05-281-2/+0
| | | | | AS::Multibyte are no longer required by access and filters string core extensions.
* Update the documentation and add CHANGELOG entryRafael Mendonça França2012-05-261-1/+1
|
* Revert "Merge pull request #6354 from lest/patch-1"Carlos Galdino + Rafael Mendonça França2012-05-161-0/+2
| | | | | | | This reverts commit e8feaff60b9c04d34ad234f7d17b5d2ad9cc7a24, reversing changes made to 9adf28c026070afb78b80027521a4ddddd68d697. Reason: This broke the actionmailer tests
* remove unnecessary requireSergey Nartimov2012-05-161-2/+0
| | | | | - access & filters don't use multibyte ext - transliterate requires only AS::Multibyte but not multibyte ext
* remove unnecessary 'examples' noiseFrancesco Rodriguez2012-05-111-1/+0
|
* Tests for regexp separator in String#truncateAlexey Gaziev2012-04-291-1/+4
| | | | https://github.com/rails/rails/commit/5a7513593f64e0ff7e4de1ee37bac5eeddfae270
* String quotes and trailing spacesAlexey Gaziev2012-04-291-4/+4
|
* AS core_ext refactoringAlexey Gaziev2012-04-291-5/+9
|
* refactor String#truncate not to use mb_charsSergey Nartimov2012-01-041-6/+5
|
* Example descriptions and their examples were flipped. Fix.Ben Orenstein2011-03-051-3/+3
|
* revises the documentation of String#truncate and the truncate helperXavier Noria2010-06-021-13/+9
|
* Extracted String#truncate from TextHelper#truncate [DHH]David Heinemeier Hansson2010-06-011-0/+33
|
* Convert String conversions, filters, starts/ends_with, and multibyte ↵Jeremy Kemper2009-03-281-23/+17
| | | | extension modules to class reopen
* Applied the faster squish version (closes #11123) [jordi]David Heinemeier Hansson2008-03-131-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9015 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add String#squish and String#squish! to remove consecutive chunks of ↵Michael Koziarski2008-02-161-0/+24
whitespace. Closes #11123 [jordi, Henrik N] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8878 5ecf4fe2-1ee6-0310-87b1-e25e094e27de