aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json
Commit message (Collapse)AuthorAgeFilesLines
* Perf: speed up json encoding.Emilio Tagua2010-09-221-3/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fixed some issues with JSON encodingJakub Suder2010-09-071-6/+44
| | | | | | | | | | | - 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>
* Move Date#xmlschema to conversions and add a missing requireSantiago Pastorino2010-07-041-0/+2
|
* Time#formatted_offset is defined in core_ext/time/conversionsSantiago Pastorino2010-07-021-0/+1
| | | | [#4979]
* Time#as_json: use Time#formatted_offset instead of strftime %z directive, ↵Geoff Buesing2010-07-021-1/+1
| | | | | | | | which is non-standard and inaccurate on some platforms (e.g., Mac OS X). [#4979] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Time has it own implementation of xmlschema, now AMo doesn't depend on TZInfoSantiago Pastorino2010-07-021-2/+2
| | | | | | [#4979 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* AS json refactor, move to_json implementation to core_ext and a cleanup a ↵Santiago Pastorino2010-07-012-35/+8
| | | | bit the code
* Work around the fact the JSON gem was overwriting to_json implementation for ↵José Valim2010-06-261-5/+14
| | | | | | | all Ruby core classes. This is required because the JSON gem is incompatible with Rails behavior and was not allowing ActiveModel::Errors to be serialized. So we need to ensure Rails implementation is the one triggered. [#4890 state:resolved]
* Fix Yajl backend discovery in ActiveSupport::JSONMaxime RETY2010-06-181-1/+1
| | | | | | [#4897 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* removes spurious .rb in requireSantiago Pastorino2010-06-131-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* adds a comment explaining why BigDecimal#as_json returns a JSON stringXavier Noria2010-05-031-1/+9
|
* Missing require added make pass activesupport/test/json/encoding_test.rb in ↵Santiago Pastorino2010-05-021-0/+1
| | | | | | isolation Signed-off-by: Xavier Noria <fxn@hashref.com>
* use ordinary syntax for options to be well-formed in 1.8Xavier Noria2010-04-271-1/+1
|
* JSON: encode objects that don't have a native JSON representation using ↵Jeremy Kemper2010-04-261-5/+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.
* Disprefer JSONGem decoder since it only decodes JSON objectsJeremy Kemper2010-03-091-1/+1
|
* Automatically prefer Yajl or JSON backend over Yaml, if availableJeremy Kemper2010-02-051-1/+16
|
* Add yajl-ruby as a JSON parsing backendBrian Lopez2010-02-051-0/+40
| | | | | | [#2666 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Changed the default ActiveSupport.use_standard_json_time_format from false ↵David Heinemeier Hansson2010-01-031-1/+2
| | | | | | to true and ActiveSupport.escape_html_entities_in_json from true to false to match previously announced Rails 3 defaults [DHH]
* Fix ActiveSupport::JSON encoding of control characters [\x00-\x1f]Dwayne Litzenberger2009-12-231-2/+11
| | | | | | | | | | | | | | 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-1/+1
|
* Ruby 1.9.2: work around changes to flatten and nil.to_strJeremy Kemper2009-11-081-9/+12
|
* Clarify date/time dependenciesJeremy Kemper2009-11-021-3/+0
|
* Clean up spurious JSON decoding test failureJeremy Kemper2009-09-133-8/+5
|
* 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>
* 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>
* JSON.escape returns UTF-8 stringsJeremy Kemper2009-07-011-5/+7
| | | | [#2849 state:resolved]
* uses Hash#except/sliceJeremy Kemper2009-07-011-0/+2
|
* Add basic JSON serializer to AMoJoshua Peek2009-06-172-0/+6
|
* Simplify json decoder backend lazy loadJeremy Kemper2009-06-081-4/+2
|
* Ruby 1.9: fix json encodingJeremy Kemper2009-06-081-1/+2
|
* JSON: split encoding and coercionJeremy Kemper2009-06-0815-211/+240
|
* load the JSON Backend lazily. If the JSON gem is already loaded, use the ↵rick2009-05-172-2/+6
| | | | JSONGem backend by default.
* Add support for parsing XML and JSON from an IO as well as a string [#2659 ↵Brian Lopez2009-05-172-2/+8
| | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Use __send__ for BasicObject friendlinessJeremy Kemper2009-04-261-1/+1
|
* Now that we have a separate internal rails_to_json, use a separate circular ↵Jeremy Kemper2009-04-2615-25/+26
| | | | reference stack instead of sticking it in the options hash
* Privatize rails_to_jsonJeremy Kemper2009-04-2614-134/+150
|
* Extract json string escapingJeremy Kemper2009-04-261-32/+1
|
* Only Object to_json alias is needed. Prefer nil options.Jeremy Kemper2009-04-2614-33/+12
|
* Track object ids so the objects needn't respond to ==Jeremy Kemper2009-04-261-2/+2
|
* * Add pluggable JSON backends with support for the JSON gem. [rick]rick2009-04-2318-100/+163
| | | | | | | | | | | | | | 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
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-221-0/+2
|
* stdlib autoloads were hanging on 1.9.1Jeremy Kemper2009-04-221-4/+2
|
* Autoload YAML and StringScanner for JSON decodingJeremy Kemper2009-04-171-2/+2
|
* Explicit dependency on Object#instance_values extensionJeremy Kemper2009-03-281-0/+2
|
* Explicit dependency on Array#wrap extensionJeremy Kemper2009-03-281-0/+2
|
* Explicit dependency on String#start_with? extensionJeremy Kemper2009-03-281-3/+5
|
* Reverted affe50105f7027a44eb6e9cfb56f5b3fc070b19b and added more JSON ↵Ubiratan Pires Alberton2009-03-111-1/+10
| | | | | | | | | | decoding tests. Works on Ruby 1.8 and 1.9 [#1100 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Remove untested part from 9b9b2937ce3bef3bca9d22821e76c40cc74fa689Pratik Naik2009-03-101-10/+2
|
* Properly decode \u escape sequences in JSON [#1100 state:resolved] [Tim ↵Tim Pope2009-03-101-3/+20
| | | | | | Pope, Philip Hallstrom] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>