aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/string_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* removes orphan tests, custom String#% was removed from AS in 39d6f9eXavier Noria2010-11-191-69/+0
|
* let String#strip_heredoc handle blank lines even if they are not indentedXavier Noria2010-08-301-0/+9
|
* implements String#strip_heredocXavier Noria2010-08-291-0/+23
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Added getbyte as a core_ext to Ruby < 1.9Santiago Pastorino2010-06-271-0/+8
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Extracted String#truncate from TextHelper#truncate [DHH]David Heinemeier Hansson2010-06-011-0/+29
|
* Use multibyte proxy class on 1.9, refactor Unicode.Norman Clarke2010-05-211-5/+3
| | | | | | | | | | Makes String#mb_chars on Ruby 1.9 return an instance of ActiveSupport::Multibyte::Chars to work around 1.9's lack of Unicode case folding. Refactors class methods from ActiveSupport::Multibyte::Chars into new Unicode module, adding other related functionality for consistency. [#4594 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Final iteration of use better testing methodsNeeraj Singh2010-05-191-7/+7
| | | | | | [#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Revert "Moved encoding work in progress to a feature branch."wycats2010-05-171-0/+8
| | | | This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
* Moved encoding work in progress to a feature branch.Jeremy Kemper2010-05-161-8/+0
| | | | This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
* Initial work to improve the state of encodings for templateswycats2010-05-161-0/+8
|
* updates String#to_(date|date_time|time) to return nil for blank stringsDaniel Neighman2010-04-211-3/+6
|
* removes code written for Ruby < 1.8.7Xavier Noria2010-04-171-12/+0
|
* Fix some more warnings on 1.9wycats2010-03-171-1/+1
|
* Be sure to pass through args to to_yamlJeremy Kemper2010-03-111-1/+1
|
* OutputBuffer#to_yaml should return string yaml, not some custom class dumpJeremy Kemper2010-03-111-0/+4
|
* Fixed html_safe test cases which weren't testing correctlySantiago Pastorino and José Ignacio Costa2010-02-051-17/+20
| | | | | | [#3845 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* For performance reasons, you can no longer call html_safe! on Strings. ↵Yehuda Katz2010-01-311-33/+34
| | | | | | | | | | | | Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("</form>".html_safe), you can do safe_concat("</form>"), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe.
* String#exclude? core extension: inverse of #include?Jeremy Kemper2009-12-271-0/+7
|
* String#<< should work for any object which responds to :to_str, so enable ↵José Valim2009-12-261-0/+24
| | | | this without the performance hit and make Fixnum safe by default.
* Consolidate date & time landscape: require 'active_support/time'Jeremy Kemper2009-11-141-1/+1
|
* Fix missing dependencyJeremy Kemper2009-11-091-0/+1
|
* String#each_char is not needed for Ruby >= 1.8.7Xavier Noria2009-11-091-11/+0
|
* String#start_with? and String#end_with? are not needed for Ruby >= 1.8.7, ↵Xavier Noria2009-11-091-8/+0
| | | | leaves their plural aliases though
* String#bytesize is not needed for Ruby >= 1.8.7Xavier Noria2009-11-091-7/+0
|
* Switch to on-by-default XSS escaping for rails.Michael Koziarski2009-10-081-0/+86
| | | | | | | | | | | | This consists of: * String#html_safe! a method to mark a string as 'safe' * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it * Calls to String#html_safe! throughout the rails helpers * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB) * New ERB implementation based on erubis which uses a SafeBuffer instead of a String Hat tip to Django for the inspiration.
* Shush interpolation warningsJoshua Peek2009-09-131-2/+6
|
* Extract String#bytesize shimJeremy Kemper2009-08-011-0/+7
|
* * don't include String#% for Ruby 1.9Sven Fuchs2009-07-181-5/+8
| | | | | | | | | | * raise a KeyError exception for missing named interpolation args (like Ruby 1.9 does) * raise an ArgumentError when mixing named and unnamed placeholders (like Ruby 1.9 does) * improve docs and comply a bit more w/ Rails names/conventions [#2870 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Ruby 1.9 style String interpolation support for lower ruby versions. Thanks ↵Lawrence Pit2009-07-071-0/+62
| | | | | | to code from Masao Mutoh's GetText gem. [#2870 state:resolved] Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
* String #to_time and #to_datetime: handle fractional seconds [#864 ↵Jason Frey (Fryguy)2009-06-071-0/+3
| | | | state:resolved]
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-221-0/+1
|
* Merge branch 'master' into cherryJeremy Kemper2009-04-201-0/+2
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: activesupport/CHANGELOG activesupport/lib/active_support/core_ext/class/delegating_attributes.rb activesupport/lib/active_support/core_ext/hash/conversions.rb activesupport/lib/active_support/core_ext/module/attribute_accessors.rb activesupport/lib/active_support/core_ext/string/multibyte.rb activesupport/lib/active_support/core_ext/time/calculations.rb activesupport/lib/active_support/deprecation.rb
| * Clearer String#first and #last edge cases. Fix that foo.first(0) == instead ↵Jeremy Kemper2009-04-171-0/+2
| | | | | | | | of foo.
* | Explicit test dependenciesJeremy Kemper2009-03-291-2/+1
| |
* | Explicit test dependenciesJeremy Kemper2009-03-281-0/+3
|/
* Allow String#parameterize to accept a separator [#2157 state:resolved]Sam Granieri2009-03-071-0/+18
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Switch to AS::TestCase for assert_deprecatedJeremy Kemper2008-11-151-2/+2
|
* Deprecated String#chars in favor of String#mb_chars.Manfred Stienstra2008-09-211-0/+6
|
* Move with_kcode helper to abstract_unit. Add tests for multibyte string ↵Manfred Stienstra2008-09-211-6/+47
| | | | extensions.
* Fix ActiveRecord::Base.quote_bound_value for ActiveSupper::Multibyte::Chars ↵Manfred Stienstra2008-09-111-0/+6
| | | | | | | | | | values. - Adds String#acts_like_string? - Adds Chars#acts_like_string? Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1029 state:committed]
* camelize(:lower) should always downcase first character. [#696 state:resolved]Amos King2008-08-221-0/+4
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add String#squish and String#squish! to remove consecutive chunks of ↵Michael Koziarski2008-02-161-0/+17
| | | | | | whitespace. Closes #11123 [jordi, Henrik N] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8878 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: declare utf-8 file encodingJeremy Kemper2008-02-021-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8789 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* require abstract_unit directly since test is in load pathJeremy Kemper2008-01-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Multibyte: skip String#each_char test for Ruby 1.9Jeremy Kemper2007-12-211-8/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8461 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: 'a'.ord == 'a'[0]Jeremy Kemper2007-12-151-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: prefer builtin String#starts_ and ends_with? if available ↵Jeremy Kemper2007-12-151-1/+9
| | | | | | [chuyeow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Honor Ruby's default calendar reform setting when creating DateTime objects ↵Geoff Buesing2007-11-241-1/+9
| | | | | | via ActiveRecord's Time -> DateTime overflow, Time#time_with_datetime_fallback, Time#to_datetime, Date#to_datetime and String#to_datetime. Closes #10201 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Mark String#each_char test failing with Ruby 1.9Jeremy Kemper2007-09-271-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7656 5ecf4fe2-1ee6-0310-87b1-e25e094e27de