Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | defines String#indent [closes #7263] [Xavier Noria & Ace Suares] | Xavier Noria | 2012-08-07 | 1 | -0/+43 |
| | |||||
* | html_escape should escape single quotes | Santiago Pastorino | 2012-07-31 | 1 | -3/+3 |
| | | | | | https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content Closes #7215 | ||||
* | Make ActiveSupport::Inflector locale aware and multilingual | David Celis | 2012-07-30 | 1 | -4/+18 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Inflector is currently not very supportive of internationalized websites. If a user wants to singularize and/or pluralize words based on any locale other than English, they must define each case in locale files. Rather than create large locale files with mappings between singular and plural words, why not allow the Inflector to accept a locale? This patch makes ActiveSupport::Inflector locale aware and uses `:en`` unless otherwise specified. Users will still be provided a list of English (:en) inflections, but they may additionally define inflection rules for other locales. Each list is kept separately and permanently. There is no reason to limit users to one list of inflections: ActiveSupport::Inflector.inflections(:es) do |inflect| inflect.plural(/$/, 's') inflect.plural(/([^aeéiou])$/i, '\1es') inflect.plural(/([aeiou]s)$/i, '\1') inflect.plural(/z$/i, 'ces') inflect.plural(/á([sn])$/i, 'a\1es') inflect.plural(/é([sn])$/i, 'e\1es') inflect.plural(/í([sn])$/i, 'i\1es') inflect.plural(/ó([sn])$/i, 'o\1es') inflect.plural(/ú([sn])$/i, 'u\1es') inflect.singular(/s$/, '') inflect.singular(/es$/, '') inflect.irregular('el', 'los') end 'ley'.pluralize(:es) # => "leyes" 'ley'.pluralize(:en) # => "leys" 'avión'.pluralize(:es) # => "aviones" 'avión'.pluralize(:en) # => "avións" A multilingual Inflector should be of use to anybody that is tasked with internationalizing their Rails application. Signed-off-by: David Celis <david@davidcelis.com> | ||||
* | Fix doc example for dasherize | Marc-Andre Lafortune | 2012-06-15 | 1 | -1/+1 |
| | |||||
* | remove unnecessary require | Sergey Nartimov | 2012-05-28 | 2 | -4/+0 |
| | | | | | AS::Multibyte are no longer required by access and filters string core extensions. | ||||
* | Update the documentation and add CHANGELOG entry | Rafael Mendonça França | 2012-05-26 | 1 | -1/+1 |
| | |||||
* | doesn't modify params in SafeBuffer#% | Vasiliy Ermolovich | 2012-05-18 | 1 | -3/+1 |
| | |||||
* | Revert "Merge pull request #6354 from lest/patch-1" | Carlos Galdino + Rafael Mendonça França | 2012-05-16 | 2 | -0/+4 |
| | | | | | | | This reverts commit e8feaff60b9c04d34ad234f7d17b5d2ad9cc7a24, reversing changes made to 9adf28c026070afb78b80027521a4ddddd68d697. Reason: This broke the actionmailer tests | ||||
* | remove unnecessary require | Sergey Nartimov | 2012-05-16 | 2 | -4/+0 |
| | | | | | - access & filters don't use multibyte ext - transliterate requires only AS::Multibyte but not multibyte ext | ||||
* | fix safe string interpolation with SafeBuffer#%, closes #6352 | Vasiliy Ermolovich | 2012-05-16 | 1 | -0/+14 |
| | |||||
* | remove backported string interpolation | Vasiliy Ermolovich | 2012-05-15 | 1 | -2/+0 |
| | |||||
* | removing unnecessary 'examples' noise from activesupport | Francesco Rodriguez | 2012-05-13 | 1 | -1/+1 |
| | |||||
* | removing trailing spaces | Francesco Rodriguez | 2012-05-11 | 1 | -3/+3 |
| | |||||
* | added docs to String#to_datetime | Francesco Rodriguez | 2012-05-11 | 1 | -0/+6 |
| | |||||
* | added docs to String#to_date | Francesco Rodriguez | 2012-05-11 | 1 | -0/+6 |
| | |||||
* | added examples to String#exclude? | Francesco Rodriguez | 2012-05-11 | 1 | -1/+6 |
| | |||||
* | remove unnecessary 'examples' noise | Francesco Rodriguez | 2012-05-11 | 3 | -9/+0 |
| | |||||
* | fix String#last example | Francesco Rodriguez | 2012-05-11 | 1 | -1/+1 |
| | |||||
* | fix String#last example | Francesco Rodriguez | 2012-05-11 | 1 | -1/+1 |
| | |||||
* | added docs to String#last | Francesco Rodriguez | 2012-05-11 | 1 | -0/+10 |
| | |||||
* | improve String#first docs | Francesco Rodriguez | 2012-05-11 | 1 | -4/+3 |
| | |||||
* | fix typo in String#first | Francesco Rodriguez | 2012-05-11 | 1 | -1/+1 |
| | |||||
* | added docs to String#first | Francesco Rodriguez | 2012-05-11 | 1 | -0/+11 |
| | |||||
* | added docs to String#from | Francesco Rodriguez | 2012-05-11 | 1 | -0/+13 |
| | |||||
* | improve String#to docs | Francesco Rodriguez | 2012-05-11 | 1 | -2/+2 |
| | |||||
* | added docs to String#to | Francesco Rodriguez | 2012-05-11 | 1 | -0/+13 |
| | |||||
* | added docs to String#at | Francesco Rodriguez | 2012-05-11 | 1 | -0/+25 |
| | |||||
* | Tests for regexp separator in String#truncate | Alexey Gaziev | 2012-04-29 | 1 | -1/+4 |
| | | | | https://github.com/rails/rails/commit/5a7513593f64e0ff7e4de1ee37bac5eeddfae270 | ||||
* | String quotes and trailing spaces | Alexey Gaziev | 2012-04-29 | 4 | -58/+58 |
| | |||||
* | AS core_ext refactoring pt.2 | Alexey Gaziev | 2012-04-29 | 2 | -3/+5 |
| | |||||
* | AS core_ext refactoring | Alexey Gaziev | 2012-04-29 | 3 | -23/+44 |
| | |||||
* | Stop SafeBuffer#clone_empty from issuing warnings | Carlos Antonio da Silva | 2012-03-02 | 1 | -3/+1 |
| | | | | | | | | | | | | Logic in clone_empty method was dealing with old @dirty variable, which has changed by @html_safe in this commit: https://github.com/rails/rails/commit/139963c99a955520db6373343662e55f4d16dcd1 This was issuing a "not initialized variable" warning - related to: https://github.com/rails/rails/pull/5237 The logic applied by this method is already handled by the [] override, so there is no need to reset the variable here. | ||||
* | Ensure [] respects the status of the buffer. | José Valim | 2012-02-29 | 1 | -12/+18 |
| | |||||
* | delete vulnerable AS::SafeBuffer#[] | Akira Matsuda | 2012-02-20 | 1 | -6/+0 |
| | |||||
* | add AS::SafeBuffer#clone_empty | Akira Matsuda | 2012-02-20 | 1 | -0/+6 |
| | |||||
* | revise docs [ci skip] | Vijay Dev | 2012-02-01 | 1 | -1/+1 |
| | |||||
* | Move escaping regexps to constants | Carlos Antonio da Silva | 2012-02-01 | 1 | -2/+4 |
| | |||||
* | Move escape_once logic to ERB::Util, where it belongs to | Carlos Antonio da Silva | 2012-02-01 | 1 | -0/+15 |
| | | | | | | All the logic is based on the HTML_ESCAPE constant available in ERB::Util, so it seems more logic to have the entire method there and just delegate the helper to use it. | ||||
* | Change ActiveRecord::Errors to ActiveModel::Errors in guides | Carlos Antonio da Silva | 2012-01-25 | 1 | -2/+2 |
| | | | | | | | Use ActiveModel::Errors in inflection example docs as well. Also fixes wrong information and link to locale file related to Errors#full_messages in I18n guide. | ||||
* | refactor String#truncate not to use mb_chars | Sergey Nartimov | 2012-01-04 | 1 | -6/+5 |
| | |||||
* | No need to override the to_yaml method in ActiveSupporte::SafeBuffer | Rafael Mendonça França | 2012-01-04 | 1 | -5/+0 |
| | |||||
* | No need to check if YAML::ENGINE is defined since ruby 1.9 does that | Rafael Mendonça França | 2012-01-04 | 1 | -1/+1 |
| | |||||
* | remove checks for encodings availability | Sergey Nartimov | 2011-12-25 | 1 | -88/+24 |
| | |||||
* | deprecate String#encoding_aware? and remove its usage | Sergey Nartimov | 2011-12-24 | 1 | -1/+4 |
| | |||||
* | no more need to make Time#to_date and Time#to_datetime public | Sergey Nartimov | 2011-12-22 | 1 | -1/+0 |
| | | | | they are public in actual 1.9 ruby version (tested at least in 1.9.2-p180) | ||||
* | We don't need a special html_escape for 1.8 anymore | Guillermo Iguaran | 2011-12-21 | 1 | -27/+15 |
| | |||||
* | remove support for ruby 1.8 in AS String extensions | Sergey Nartimov | 2011-12-21 | 1 | -29/+0 |
| | |||||
* | Initial pass at removing dead 1.8.x code from Active Support. | José Valim | 2011-12-20 | 2 | -71/+49 |
| | | | | | | There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome. | ||||
* | Remove duplicate html_escape docs | Jeremy Kemper | 2011-12-11 | 1 | -10/+1 |
| | |||||
* | Use 1.9 native XML escaping to speed up html_escape and shush regexp warnings | Jeremy Kemper | 2011-12-11 | 1 | -15/+36 |
| | | | | | | | | | | | | length user system total real before 6 0.010000 0.000000 0.010000 ( 0.012378) after 6 0.010000 0.000000 0.010000 ( 0.012866) before 60 0.040000 0.000000 0.040000 ( 0.046273) after 60 0.040000 0.000000 0.040000 ( 0.036421) before 600 0.390000 0.000000 0.390000 ( 0.390670) after 600 0.210000 0.000000 0.210000 ( 0.209094) before 6000 3.750000 0.000000 3.750000 ( 3.751008) after 6000 1.860000 0.000000 1.860000 ( 1.857901) |