aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Allow frameworks to be required by their gem name"Jeremy Kemper2009-09-121-1/+0
| | | | | | | This has just been confusing. Better to educate than band-aid. This reverts commit 18a24274ec823ded4ffa29bf33fd3d76816aab7e. Originally from http://dev.rubyonrails.org/ticket/8845 [drnic]
* ruby 1.9 friendly secure_compareJakub Kuźma2009-09-121-9/+6
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Remove redundant checks for valid character regexp in ↵Beau Harrington2009-09-101-2/+2
| | | | | | | | ActiveSupport::Multibyte#clean and #verify. [#3181 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Refactor new callbacks and AR implementation.José Valim2009-09-081-56/+58
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-081-46/+53
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Ruby 1.9: fix MessageVerifier#secure_compareJeremy Kemper2009-09-081-9/+27
|
* Fix a messed up merge commitMichael Koziarski2009-09-041-4/+0
|
* Add verify and clean methods to ActiveSupport::Multibyte.Michael Koziarski2009-09-043-18/+98
| | | | | | | | | | | | When accepting character input from outside of your application you can't blindly trust that all strings are properly encoded. With these methods you can check incoming strings and clean them up if necessary. Signed-off-by: Michael Koziarski <michael@koziarski.com> Conflicts: activesupport/lib/active_support/multibyte.rb
* Fix timing attack vulnerability in ActiveSupport::MessageVerifier.Coda Hale2009-09-041-3/+16
| | | | | | Use a constant-time comparison algorithm to compare the candidate HMAC with the calculated HMAC to prevent leaking information about the calculated HMAC. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Duplicating the options hash in Date#advance to prevent modification of the ↵Jay Pignata2009-08-311-0/+1
| | | | | | original [#1133 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Correct Regexp#un/optionalize assertions and fix uncovered failuresJeffrey Hardy2009-08-261-0/+2
| | | | | | [#3102 state:incomplete] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Ruby 1.9: fix Time#beginning_of_day inaccuracy due to subtracting a FloatJeremy Kemper2009-08-221-1/+2
|
* Allow superclass_delegating_accessor to take a block for initial set.Yehuda Katz2009-08-111-3/+4
|
* More perf work:Yehuda Katz2009-08-111-7/+15
| | | | | | | | | | | | | | * Move #set_cookie and #delete_cookie inline to optimize. These optimizations should almost certainly be sent back upstream to Rack. The optimization involves using an ivar for cookies instead of indexing into the headers each time. * Was able to use a bare Hash for headers now that cookies have their own joining semantics (some code assumed that the raw cookies were an Array). * Cache blankness of body on body= * Improve expand_cache_key for Arrays of a single element (common in our case) * Use a simple layout condition check unless conditions are used * Cache visible actions * Lazily load the UrlRewriter * Make etag an ivar that is set on prepare!
* Got overhead down from 127 to 85. All tests pass:Yehuda Katz2009-08-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * Tentatively replaced HeaderHash with SimpleHeaderHash, which does not preserve case but does handle converting Arrays to Strings in to_hash. This requires further discussion. * Moved default_charset to ActionDispatch::Response to avoid having to hop over to ActionController. Ideally, this would be a constant on AD::Response, but some tests expect to be able to change it dynamically and I didn't want to change them yet. * Completely override #initialize from Rack::Response. Previously, it was creating a HeaderHash, and then we were creating an entirely new one. There is no way to call super without incurring the overhead of creating a HeaderHash. * Override #write from Rack::Response. Its implementation tracks Content-Length, and doing so adds additional overhead that could be mooted if other middleware changes the body. It is more efficiently done at the top-level server. * Change sending_file to an instance_variable instead of header inspection. In general, if a state is important, it should be set as a property of the response not reconstructed later. * Set the Etag to @body instead of .body. AS::Cache.expand_cache_key handles Arrays fine, and it's more efficient to let it handle the body parts, since it is not forced to create a joined String. * If we detect the default cache control case, just set it, rather than setting the constituent parts and then running the normal (expensive) code to generate the string.
* Allow delegating to nil, because the method might actually exist on itBryan Helmkamp2009-08-101-4/+9
|
* Correctly handle offsets in Multibyte::Chars#index and #rindex.Erik Ostrom2009-08-091-3/+5
| | | | | | | | The offset in codepoints was being passed directly to the wrapped string's index/rindex method. Now we translate the offset into bytes first. [#3028 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix that JSON parser fails to read escaped backslashes.Daniel Sheppard2009-08-091-1/+4
| | | | | | [#973 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix that irregular plural inflections should not be double-pluralized: ↵Prem Sichanugrist2009-08-091-0/+3
| | | | | | | | 'people'.pluralize should return 'people' not 'peoples'. [#1183 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add rindex to ActiveSupport::Multibyte::Chars.Erik Ostrom2009-08-091-0/+13
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* make private_and_public_methods unmemoizable [#2372 state:resolved]jeem2009-08-091-1/+1
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Support deep-merging HashWithIndifferentAccess.Andrew Moreland2009-08-091-4/+5
| | | | | | [#2732 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix that Hash#to_xml and Array#to_xml shouldn't modify their options hashes ↵David Burger2009-08-092-0/+2
| | | | | | [#672 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Remove unnecessary &block from Range#sum and add tests for (num..float).sumPratik Naik2009-08-091-1/+1
|
* Optimize Range#sum only for integers [#2489]José Valim2009-08-091-2/+3
|
* Setting usec (and nsec for Ruby 1.9) on Time#end_of_* methods [#1255 ↵Hugo Peixoto2009-08-091-8/+8
| | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Optimize Range#sum to use arithmetic progression when a block is not given ↵José Valim2009-08-091-0/+9
| | | | | | [#2489]. Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix deprecating =-methods by using send [#2431 status:resolved]Michael Siebert2009-08-091-9/+9
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Temporary fix to get our LoadError monkey-patch working with newer JRuby. We ↵Yehuda Katz2009-08-091-1/+2
| | | | should probably remove MissingSourceFile and just monkey-patch LoadError instead of overriding LoadError.new.
* Enumerable#sum now works will all enumerables, even if they don't respond to ↵Marc-Andre Lafortune2009-08-081-4/+2
| | | | | | | | :size [#2489 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed a bug in JSON decoding with Yaml backend, where a combination of ↵Bas Van Klinkenberg2009-08-081-7/+10
| | | | | | dates, escaped or unicode encoded data and arrays would make the parser fail with a ParseError exception. [#2831 state:resolved] Signed-off-by: Yehuda Katz <wycats@gmail.com>
* Extract String#bytesize shimJeremy Kemper2009-08-012-3/+7
|
* Merge branch 'master' of git://github.com/rails/railsJosé Valim2009-07-2811-14/+18
|\
| * Merge docrailsPratik Naik2009-07-2511-14/+18
| |
* | Solving merge conflicts.José Valim2009-07-212-74/+81
|\|
| * Ruby 1.9.2 compat: name method was renamed to __name__ since MiniTest 1.4.x ↵Akira Matsuda2009-07-211-1/+2
| | | | | | | | | | | | [#2922 state:resolved] Signed-off-by: Yehuda Katz <wycats@gmail.com>
| * * 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>
* | Merge branch 'master' of git://github.com/rails/railsJosé Valim2009-07-164-4/+8
|\|
| * ActiveSupport Hash optimizations [#2902 state:resolved]Lourens Naude2009-07-154-4/+8
| | | | | | | | Signed-off-by: Carl Lerche <carllerche@mac.com>
* | Merge branch 'master' of git://github.com/rails/railsJosé Valim2009-07-084-75/+164
|\|
| * Use the i18n gem if present instead of vendor code. [#2871 state:resolved]Lawrence Pit2009-07-071-5/+4
| | | | | | | | Signed-off-by: Yehuda Katz <wycats@gmail.com>
| * Ruby 1.9 style String interpolation support for lower ruby versions. Thanks ↵Lawrence Pit2009-07-072-0/+88
| | | | | | | | | | | | to code from Masao Mutoh's GetText gem. [#2870 state:resolved] Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
| * Get Initializer tests running without requiring parts of Rails being loaded ↵Yehuda Katz + Carl Lerche2009-07-061-70/+72
| | | | | | | | first
* | Use active_support/mini since we just need inflections.José Valim2009-07-061-2/+2
| |
* | Merge branch 'master' of git://github.com/rails/railsJosé Valim2009-07-034-7/+28
|\|
| * Adds support for def self.setup in isolation tests for setup that should be ↵Yehuda Katz + Carl Lerche2009-07-021-0/+5
| | | | | | | | run only once in the parent
| * Fixed ActiveSupport::OrderedHash::[] work identically to ::Hash::[] in ruby ↵Brian Abreu2009-07-021-4/+18
| | | | | | | | | | | | 1.8.7 [#2832 state:resolved] Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
| * wycats forgot a +1, so I added it [#2749 state:resolved]Aaron Patterson2009-07-021-1/+1
| | | | | | | | Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
| * make #inspect if zero length duration return '0 seconds' instead of empty ↵Levin Alexander2009-07-021-2/+4
| | | | | | | | | | | | string [#2838 state:resolved] Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
* | Merge branch 'master' of git://github.com/rails/railsJosé Valim2009-07-0213-36/+144
|\|