aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string
Commit message (Collapse)AuthorAgeFilesLines
...
| * For performance reasons, you can no longer call html_safe! on Strings. ↵Yehuda Katz2010-01-311-21/+85
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Updating copyright dates on all licensesMikel Lindsaar2010-02-011-1/+1
|/
* Merge docrailsPratik Naik2010-01-171-2/+2
|
* String#exclude? core extension: inverse of #include?Jeremy Kemper2009-12-271-0/+6
|
* String#<< should work for any object which responds to :to_str, so enable ↵José Valim2009-12-261-0/+12
| | | | this without the performance hit and make Fixnum safe by default.
* Simplify and improve the performance of output_safetyYehuda Katz2009-12-241-22/+6
|
* Instead of marking raw text in templates as safe, and then putting them ↵Yehuda Katz2009-12-241-0/+1
| | | | through String#<< which checks if the String is safe, use safe_concat, which uses the original (internal) String#<< and leaves the safe flag as is. Results in a significant performance improvement.
* Remove concat before overriding itJoshua Peek2009-12-011-6/+7
|
* Check whether another lib has implemented ruby 1.9 string interp syntaxJeremy Kemper2009-11-181-1/+1
|
* String#each_char is not needed for Ruby >= 1.8.7Xavier Noria2009-11-091-13/+0
|
* String#start_with? and String#end_with? are not needed for Ruby >= 1.8.7, ↵Xavier Noria2009-11-091-14/+0
| | | | leaves their plural aliases though
* String#bytesize is not needed for Ruby >= 1.8.7Xavier Noria2009-11-092-6/+0
|
* Revert "Bundle I18n 0.2.0."Yehuda Katz2009-11-091-1/+1
| | | | This reverts commit 83f329f5f30567a10bc96410da230bf986db8ad4.
* Bundle I18n 0.2.0.José Valim2009-11-091-1/+1
|
* Break up inflector to reduce the dependency burden on dependency-les methods ↵Yehuda Katz2009-11-071-0/+2
| | | | like constantize.
* Switch to on-by-default XSS escaping for rails.Michael Koziarski2009-10-081-0/+43
| | | | | | | | | | | | 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.
* Restore split between require-time and runtime load path mungery. Simplifies ↵Jeremy Kemper2009-09-241-1/+1
| | | | vendor requires.
* Rollback AS bundler work and improve activation of vendored dependenciesJoshua Peek2009-09-131-1/+1
|
* Extract String#bytesize shimJeremy Kemper2009-08-012-3/+7
|
* * don't include String#% for Ruby 1.9Sven Fuchs2009-07-181-73/+79
| | | | | | | | | | * 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/+87
| | | | | | 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-2/+6
| | | | state:resolved]
* Prefer behavior check to RUBY_VERSION to catch 1.8 backportsJeremy Kemper2009-04-291-1/+1
|
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-222-0/+2
|
* stdlib autoloads were hanging on 1.9.1Jeremy Kemper2009-04-221-3/+2
|
* Convert string extension modules to class reopensJeremy Kemper2009-04-224-278/+247
|
* Merge branch 'master' into cherryJeremy Kemper2009-04-201-5/+29
|\ | | | | | | | | | | | | | | | | | | | | 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) == 'foo' ↵Jeremy Kemper2009-04-201-2/+14
| | | | | | | | instead of ''
| * Clearer String#first and #last edge cases. Fix that foo.first(0) == instead ↵Jeremy Kemper2009-04-171-3/+15
| | | | | | | | of foo.
| * Bring abstract_controller up to date with rails/masterCarl Lerche & Yehuda Katz2009-04-131-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list of commits that could not be applied cleanly or are obviated with the abstract_controller refactor. They all need to be revisited to ensure that fixes made in 2.3 do not reappear in 3.0: 2259ecf368e6a6715966f69216e3ee86bf1a82a7 AR not available * This will be reimplemented with ActionORM or equivalent 06182ea02e92afad579998aa80144588e8865ac3 implicitly rendering a js response should not use the default layout [#1844 state:resolved] * This will be handled generically 893e9eb99504705419ad6edac14d00e71cef5f12 Improve view rendering performance in development mode and reinstate template recompiling in production [#1909 state:resolved] * We will need to reimplement rails-dev-boost on top of the refactor; the changes here are very implementation specific and cannot be cleanly applied. The following commits are implicated: 199e750d46c04970b5e7684998d09405648ecbd4 3942cb406e1d5db0ac00e03153809cc8dc4cc4db f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690 e3b166aab37ddc2fbab030b146eb61713b91bf55 ae9f258e03c9fd5088da12c1c6cd216cc89a01f7 44423126c6f6133a1d9cf1d0832b527e8711d40f 0cb020b4d6d838025859bd60fb8151c8e21b8e84 workaround for picking layouts based on wrong view_paths [#1974 state:resolved] * The specifics of this commit no longer apply. Since it is a two-line commit, we will reimplement this change. 8c5cc66a831aadb159f3daaffa4208064c30af0e make action_controller/layouts pick templates from the current instance's view_paths instead of the class view_paths [#1974 state:resolved] * This does not apply at all. It should be trivial to apply the feature to the reimplemented ActionController::Base. 87e8b162463f13bd50d27398f020769460a770e3 fix HTML fallback for explicit templates [#2052 state:resolved] * There were a number of patches related to this that simply compounded each other. Basically none of them apply cleanly, and the underlying issue needs to be revisited. After discussing the underlying problem with Koz, we will defer these fixes for further discussion.
| * | Introduce minimalistic package for ActiveSupport.Michael S. Klishin2008-12-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To simplify using of ActiveSupport in 3rd party libraries, a simple way to require only minimum of commonly used extensions (multibyte, inflections, array and hash extensions, #blank?, and a few others) is needed. For exactly this reason some out-of-Rails-space libraries adopted Extlib, originally from DataMapper. To keep it 2067% backwards compatible, and still available to everyone even in 2.x releases, active_support/minimalistic.rb was added. Use it like this: gem 'active_support', '>=2.3' require 'active_support/minimalistic' instead of require 'activesupport' Right now this package with RubyGems uses about 10 megs of RAM (10.01 or so). It can be further slimmed down though, once we simplify multibyte implementation that right now uses advanced accessors from Module extensions. To compare RAM usage with previous ActiveSupport versions and Extlib, at the time of writing, see http://gist.github.com/40401.
* | | Autoload StringScanner for pre-1.9 String#each_charJeremy Kemper2009-04-171-1/+1
| | |
* | | Convert String conversions, filters, starts/ends_with, and multibyte ↵Jeremy Kemper2009-03-284-149/+112
| | | | | | | | | | | | extension modules to class reopen
* | | Only require builder at startup if we need to monkey with its String#to_xs ↵Jeremy Kemper2009-03-211-3/+10
| |/ |/| | | | | demands
* | Allow String#parameterize to accept a separator [#2157 state:resolved]Sam Granieri2009-03-071-2/+2
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | Avoid circular requireJeremy Kemper2009-02-061-1/+1
|/
* Changed the fallback String#each_char to use valid 1.9 syntax.Tom Lea2008-11-221-1/+3
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Deprecated String#chars in favor of String#mb_chars.Manfred Stienstra2008-09-211-1/+4
|
* Improve documentation.Manfred Stienstra2008-09-211-13/+10
|
* Change all calls to String#chars to String#mb_chars.Manfred Stienstra2008-09-211-5/+5
|
* Simplify ActiveSupport::Multibyte and make it run on Ruby 1.9.Manfred Stienstra2008-09-212-66/+81
| | | | | | * Unicode methods are now defined directly on Chars instead of a handler * Updated Unicode database to Unicode 5.1.0 * Improved documentation
* Fix ActiveRecord::Base.quote_bound_value for ActiveSupper::Multibyte::Chars ↵Manfred Stienstra2008-09-111-0/+13
| | | | | | | | | | values. - Adds String#acts_like_string? - Adds Chars#acts_like_string? Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1029 state:committed]
* Added Inflector#parameterize for easy slug generation ("Donald E. ↵David Heinemeier Hansson2008-09-101-0/+19
| | | | Knuth".parameterize => "donald-e-knuth") #713 [Matt Darby]
* Merge with docrails.Pratik Naik2008-07-161-2/+2
|
* Remove 1.9's String#chars alsoJeremy Kemper2008-06-061-13/+11
|
* Merge docrails.Pratik Naik2008-05-251-5/+5
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ruby 1.8.7 compat: String#start_with? and #end_with?Jeremy Kemper2008-04-202-4/+16
|
* Use append_features instead of included to get the inclusion order rightJeremy Kemper2008-04-201-1/+2
|
* Override incompatible 1.8.7p1 String#charsJeremy Kemper2008-04-191-0/+6
|
* Feature check :force_encoding instead of RUBY_VERSIONJeremy Kemper2008-04-192-2/+2
|