aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json
Commit message (Collapse)AuthorAgeFilesLines
...
* checked all .rb files in the project tree for missing magic comments, one ↵Xavier Noria2011-07-231-1/+1
| | | | | | | | | | | | | | was missing Came with this one-liner for this: find . -name '*.rb' | \ xargs chardet | \ grep -v ascii | \ cut -d: -f1 -s | \ xargs -n1 ruby -0777 -ne 'puts $FILENAME if $_ !~ /#.*coding:\s*utf/i' Welcome $_.
* Merge pull request #248 from bigfix/enumerable_as_jsonJosé Valim2011-05-071-9/+24
|\ | | | | Enumerable should pass encoding options to children in #as_json/#to_json
| * Enumerable should pass encoding options to children in #as_json/#to_json.John Firebaugh2011-04-011-9/+24
| |
* | AS Json parse_error makes a return for backwards compatibility, although it ↵Josh Kalderimis2011-04-191-1/+1
| | | | | | | | will return MultiJson::DecodeError
* | removed AS backends and instead rely on MultiJson for json decodingJosh Kalderimis2011-04-181-7/+4
|/
* parse dates to yaml in json arraysDiego Carrion2011-03-221-0/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* test json decoding with time parsing disabled with all backends and respect ↵Diego Carrion2011-03-221-4/+2
| | | | | | ActiveSupport.parse_json_times when converting to yaml Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Updated the json date regex to recognize xmlschema formatted date times ↵Josh Kalderimis2011-02-121-0/+4
| | | | | | during json decoding. [#3031 state:resolved] Signed-off-by: Santiago Pastorino and Emilio Tagua <santiago+emilioe@wyeworks.com>
* Fixes an issue when decoding a json string which looks like a date but is ↵Josh Kalderimis2011-02-111-0/+2
| | | | | | invalid. This DateTime parse error is now caught and the original string is instead passed back [#6286 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Fix tests providing valid JSONSantiago Pastorino2011-02-021-2/+2
|
* Fix JSON decoding of newline character with Yaml backend [#3479 state:resolved]Maxime RETY2011-02-021-1/+5
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* use ! " " YAML string literal syntax rather than removing both quotesAaron Patterson2011-01-211-3/+1
|
* ordering can change depending on ruby version, so parse the JSON and verify ↵Aaron Patterson2011-01-171-3/+10
| | | | data structure equality
* Complex struct encoding testAlexey Nayden2011-01-151-0/+23
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Fixed various isolated test missing requires within AS.Josh Kalderimis2011-01-121-0/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fixed some issues with JSON encodingJakub Suder2010-09-071-1/+64
| | | | | | | | | | | - as_json in ActiveModel should return a hash and handle :only/:except/:methods options - Array and Hash should call as_json on their elements - json methods should not modify options argument [#5374 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Removes unused varsSantiago Pastorino2010-07-241-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Time has it own implementation of xmlschema, now AMo doesn't depend on TZInfoSantiago Pastorino2010-07-021-2/+4
| | | | | | [#4979 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* BigDecimal#as_json does not really specify the F format, it delegates that ↵Xavier Noria2010-05-031-1/+3
| | | | to whatever BigDecimal#to_s default format is, do the same in its test
* Fix BigDecimal JSON encoding test. [#4495 state:resolved]Cezary Baginski2010-04-281-3/+3
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* JSON: encode objects that don't have a native JSON representation using ↵Jeremy Kemper2010-04-261-2/+19
| | | | to_hash, if available, instead of instance_values (the old fallback) or to_s (other encoders' default). Encode BigDecimal and Regexp encode as strings to conform with other encoders. Try to transcode non-UTF-8 strings.
* Fix a JSON ordering issueYehuda Katz2010-02-101-3/+7
|
* Automatically prefer Yajl or JSON backend over Yaml, if availableJeremy Kemper2010-02-051-1/+1
|
* Add yajl-ruby as a JSON parsing backendBrian Lopez2010-02-051-0/+1
| | | | | | [#2666 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix ActiveSupport::JSON encoding of control characters [\x00-\x1f]Dwayne Litzenberger2009-12-231-1/+3
| | | | | | | | | | | | | | According to RFC 4627, only the following Unicode code points are allowed unescaped in JSON: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF However, ActiveSupport::JSON did not escape the range %x00-1f. This caused parse errors when trying to decode the resulting output. [#3345 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Repair time dependenciesJeremy Kemper2009-11-141-0/+1
|
* Clean up spurious JSON decoding test failureJeremy Kemper2009-09-131-8/+2
|
* Fix that JSON parser fails to read escaped backslashes.Daniel Sheppard2009-08-091-3/+5
| | | | | | [#973 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-1/+7
| | | | | | 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>
* JSON.escape returns UTF-8 stringsJeremy Kemper2009-07-011-2/+7
| | | | [#2849 state:resolved]
* JSON: split encoding and coercionJeremy Kemper2009-06-081-7/+12
|
* load the JSON Backend lazily. If the JSON gem is already loaded, use the ↵rick2009-05-171-0/+3
| | | | JSONGem backend by default.
* Privatize rails_to_jsonJeremy Kemper2009-04-261-1/+1
|
* * Add pluggable JSON backends with support for the JSON gem. [rick]rick2009-04-232-44/+70
| | | | | | | | | | | | | | Example: ActiveSupport::JSON.backend = "JSONGem" All internal Rails JSON encoding is now handled by ActiveSupport::JSON.encode(). Use of #to_json is not recommended, as it may clash with other libraries that overwrite it. However, you can recover Rails specific functionality if you really want to use #to_json. gem 'json' ActiveSupport::JSON.backend = "JSONGem" class ActiveRecord::Base alias to_json rails_to_json end
* Opt in to JSONJeremy Kemper2009-04-221-0/+1
|
* stdlib autoloads were hanging on 1.9.1Jeremy Kemper2009-04-221-2/+2
|
* Explicit test dependenciesJeremy Kemper2009-03-281-0/+1
|
* Reverted affe50105f7027a44eb6e9cfb56f5b3fc070b19b and added more JSON ↵Ubiratan Pires Alberton2009-03-111-1/+3
| | | | | | | | | | decoding tests. Works on Ruby 1.8 and 1.9 [#1100 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Properly decode \u escape sequences in JSON [#1100 state:resolved] [Tim ↵Tim Pope2009-03-101-1/+3
| | | | | | Pope, Philip Hallstrom] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.Jeremy Kemper2009-03-082-2/+2
| | | | [#1617 state:resolved]
* Ruby 1.9 compat: fix JSON decoding to work properly with multibyte valuesAkira Matsuda2009-02-171-0/+3
| | | | | | [#1969 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Properly quote json keys.Michael Koziarski2009-01-161-2/+2
| | | | | According to the RFC and the json.org site all json keys must be strings, and those strings must be quoted with double quotes. [#1755 state:committed]
* Fix JSON decoder date-converter regexp [#1662 state:resolved] [Jonathan del ↵Pratik Naik2009-01-071-1/+2
| | | | Strother]
* Require mocha >= 0.9.0 for AS testsJeremy Kemper2008-11-221-10/+8
|
* test nested hash with floatDan Barry2008-10-121-0/+12
| | | | | | [#652 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Move with_kcode helper to abstract_unit. Add tests for multibyte string ↵Manfred Stienstra2008-09-211-12/+0
| | | | extensions.
* Time#to_json: don't convert to utc before encoding. References #175gbuesing2008-05-181-0/+16
|
* Add config.active_support.escape_html_entities_in_json to allow disabling of ↵Rick Olson2008-04-081-0/+3
| | | | | | html entity escaping. [rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9238 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add config.active_support.use_standard_json_time_format setting so that ↵Rick Olson2008-04-011-3/+12
| | | | | | Times and Dates export to ISO 8601 dates. [rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9203 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