aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string
Commit message (Collapse)AuthorAgeFilesLines
* moves Object#singleton_class to Kernel#singleton_class to match Ruby also ↵Xavier Noria2010-04-051-1/+1
| | | | there, same for #class_eval to simplify, and adds coverage for class_eval
* Require AS singleton_class code in AS output_safetysnusnu2010-03-171-1/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Remove some 1.9 warnings (resulting in some fixed bugs). Remaining AM ↵wycats2010-03-172-4/+4
| | | | warnings are in dependencies.
* to_str works hereJeremy Kemper2010-03-151-5/+1
|
* Be sure to pass through args to to_yamlJeremy Kemper2010-03-111-2/+2
|
* Write strings to fragment cache, not outputbuffersJeremy Kemper2010-03-111-1/+5
|
* OutputBuffer#to_yaml should return string yaml, not some custom class dumpJeremy Kemper2010-03-111-0/+4
|
* Make many parts of Rails lazy. In order to facilitate this,wycats2010-03-071-91/+1
| | | | | | | | | | | | add lazy_load_hooks.rb, which allows us to declare code that should be run at some later time. For instance, this allows us to defer requiring ActiveRecord::Base at boot time purely to apply configuration. Instead, we register a hook that should apply configuration once ActiveRecord::Base is loaded. With these changes, brings down total boot time of a new app to 300ms in production and 400ms in dev. TODO: rename base_hook
* Inflection dependency, [#4067 status:resolved]Jason King2010-03-031-1/+3
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* require publicize_conversion_method to ensure to_date and to_datetime became ↵Santiago Pastorino2010-02-191-0/+1
| | | | public before redefining them (avoid warnings)
* Fix doc typo and update fast_xs URL. Thanks to Dmitrii Golub.Jeremy Kemper2010-02-071-1/+1
|
* Making SafeBuffer << an alias for concat methodSantiago Pastorino2010-02-051-5/+2
| | | | | | [#3848 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Merge branch 'master' of git://github.com/rails/railsMikel Lindsaar2010-02-021-21/+85
|\
| * 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>