aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Pull file from xml value only if it's a Hash. Closes #8190.Jeremy Kemper2007-04-261-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6583 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use XSD-compatible type names for Hash#to_xml and make the converters ↵David Heinemeier Hansson2007-04-211-1/+29
| | | | | | extendable #8047 [Tim Pope] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added yielding of builder in Hash#to_xml [DHH]David Heinemeier Hansson2007-04-191-0/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that parameters from XML should also be presented in a hash with ↵David Heinemeier Hansson2007-04-161-0/+5
| | | | | | indifferent access [DHH] Hash#with_indifferent_access now also converts hashes kept in arrays to indifferent access (makes it easier to treat HTML and XML parameters the same) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6532 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml supports YAML attributes; ActiveRecord::Base#to_xml support ↵Jeremy Kemper2007-03-181-3/+5
| | | | | | serialized attributes. Closes #7502. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Array#to_query preserves its ordering. References #7756.Jeremy Kemper2007-03-111-2/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6378 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_query CGI-escapes its keys.Jeremy Kemper2007-02-111-8/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6148 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't test for hash sort order.Jeremy Kemper2007-02-111-6/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6147 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash#to_query to turn a hash of values into a form-encoded query ↵David Heinemeier Hansson2007-01-241-0/+21
| | | | | | string [Nicholas Seckar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6038 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#slice(*keys) returns a new hash with only the given keys. #slice! ↵Jeremy Kemper2006-12-171-0/+29
| | | | | | replaces the hash with only the given keys. Works with HashWithIndifferentAccess also. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5726 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* HashWithIndifferentAccess#to_hash converts to a Hash with String keys and ↵Jeremy Kemper2006-12-161-9/+37
| | | | | | the same default value. Fix Hash#reverse_update to be an alias for reverse_merge./script/console More thoroughly test the reverse_* methods. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5725 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml handles keys with the same name as Kernel methods. Closes #6613.Jeremy Kemper2006-11-141-0/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml supports Bignum and BigDecimal. Closes #6313.Jeremy Kemper2006-09-291-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash.create_from_xml has been renamed to Hash.from_xml, alias will exist ↵David Heinemeier Hansson2006-09-201-4/+4
| | | | | | until Rails 2.0 [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix cases where empty xml nodes weren't being translated to nil in ↵Rick Olson2006-09-011-0/+24
| | | | | | Hash.create_from_xml [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Strip boolean XML content before checking for 'true' [Rick Olson]Rick Olson2006-07-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Correctly convert <foo nil=true> to nil when using Hash.create_from_xml. [Rick]Rick Olson2006-07-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4607 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4487@asus: jeremy | 2006-04-29 12:21:39 -0700Jeremy Kemper2006-07-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check whether @flash is defined? for warnings-safety. r4488@asus: jeremy | 2006-04-29 12:23:15 -0700 Check whether @flash is defined? for warnings-safety. Obviates nil? check. r4489@asus: jeremy | 2006-04-29 12:45:18 -0700 Check whether @session is defined? for warnings-safety. r4490@asus: jeremy | 2006-04-29 12:50:41 -0700 Check whether @rendering_runtime is defined? for warnings-safety. r4491@asus: jeremy | 2006-04-29 12:55:01 -0700 Check whether @_cycles is defined? for warnings-safety. r4492@asus: jeremy | 2006-04-29 12:59:19 -0700 Check whether instance variables are defined? for warnings-safety. r4493@asus: jeremy | 2006-04-29 13:14:09 -0700 Add nil @template to PrototypeHelperTest to suppress unitialized instance variable warning. r4494@asus: jeremy | 2006-04-29 13:31:34 -0700 Check whether @auto_index defined? for warnings-safety. r4495@asus: jeremy | 2006-04-29 13:32:24 -0700 Wrap content_columns redefinitions with silence_warnings. r4496@asus: jeremy | 2006-04-29 13:35:28 -0700 Wrap more redefinitions with silence_warnings. r4829@asus: jeremy | 2006-07-08 10:59:20 -0700 abstract unit, fix warnings r4830@asus: jeremy | 2006-07-08 11:06:12 -0700 Use parens to silence warning. r4831@asus: jeremy | 2006-07-08 11:06:48 -0700 Use parens to silence warning. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* HashWithIndifferentAccess shouldn't confuse false and nil. Closes #5601. Nor ↵Jeremy Kemper2006-07-051-31/+58
| | | | | | should it mistreat legitimate nil values. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4555 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed HashWithIndifferentAccess#default (closes #5586) [chris@seagul.co.uk]David Heinemeier Hansson2006-07-051-0/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More compatible Hash.create_from_xml. Closes #5523.Jeremy Kemper2006-06-291-0/+23
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash.create_from_xml(string) which will create a hash from a XML ↵David Heinemeier Hansson2006-06-161-1/+78
| | | | | | string and even typecast if possible [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* to_xml fixes, features, and speedup. Closes #4989.Jeremy Kemper2006-06-031-4/+35
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4413 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't destroy a HashWithIndifferentAccess if symbolize_keys! or ↵Marcel Molina2006-05-141-0/+11
| | | | | | stringify_keys! is called on it. Closes #5076. [Marcel Molina Jr., guy.naor@famundo.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added nicer message for assert_redirected_to (closes #4294) [court3nay, ↵Rick Olson2006-03-191-1/+5
| | | | | | Chris McGrath] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3969 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed HashWithIndifferentAccess#delete to work with both symbols and strings ↵David Heinemeier Hansson2006-03-181-0/+10
| | | | | | (closes #2176) [Caio Chassot] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Implemented nested to_xml and named elements for array xmling [DHH]David Heinemeier Hansson2006-03-091-0/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed to_xml across the board to use nice indention, better skip_attributes ↵David Heinemeier Hansson2006-03-091-14/+31
| | | | | | workings, no type on strings, and cleaned tests [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3829 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash#to_xml and Array#to_xml that makes it much easier to produce XML ↵David Heinemeier Hansson2006-03-081-1/+29
| | | | | | from basic structures [DHH] Moved Jim Weirich's wonderful Builder from Action Pack to Active Support (it's simply too useful to be stuck in AP) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix merge and dup for hashes with indifferent access (closes #3404) ↵David Heinemeier Hansson2006-01-231-0/+19
| | | | | | [kenneth.miller@bitfield.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3468 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make HashWithIndifferentAccess#update behave like Hash#update by returning ↵Marcel Molina2006-01-081-0/+23
| | | | | | the hash. Closes #3419, #3425 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash#reverse_merge, Hash#reverse_merge!, and Hash#reverse_update to ↵David Heinemeier Hansson2005-09-111-0/+4
| | | | | | ease the use of default options. Added :connector and :skip_last_comma options to Array#to_sentence git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make assert_valid_keys slightly more lenientDavid Heinemeier Hansson2005-09-091-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that HashWithIndifferentAccess stringified all keys including symbols, ↵David Heinemeier Hansson2005-05-191-0/+6
| | | | | | ints, objects, and arrays #1162 [Nicholas Seckar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed tests for indifferent accessDavid Heinemeier Hansson2005-03-071-47/+16
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@873 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed Hash#indifferent_access to also deal with include? and fetch and ↵David Heinemeier Hansson2005-03-071-0/+61
| | | | | | nested hashes #726 [Nicholas Seckar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed an exception when using Ajax based requests from Safari because Safari ↵David Heinemeier Hansson2005-03-031-6/+20
| | | | | | appends a \000 to the post body. Symbols can't have \000 in them so indifferent access would throw an exception in the constructor. Indifferent hashes now use strings internally instead. #746 [Tobias Luetke] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved Active Support into its own gemDavid Heinemeier Hansson2005-02-151-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@624 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash#stringify_keys and Hash#stringify_keys!David Heinemeier Hansson2005-02-121-0/+14
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added IndifferentAccess as a way to wrap a hash by a symbol-based store that ↵David Heinemeier Hansson2005-02-111-1/+11
| | | | | | also can be accessed by string keys git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@581 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Byte operations to Numeric, so 5.5.megabytes + 200.kilobytes #461 ↵David Heinemeier Hansson2005-01-111-2/+33
| | | | | | [Marcel Molina] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@393 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added the first of the coming core extensionsDavid Heinemeier Hansson2005-01-091-0/+14
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@349 5ecf4fe2-1ee6-0310-87b1-e25e094e27de