diff options
author | Diego Carrion <dc.rec1@gmail.com> | 2011-03-09 21:45:45 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-03-22 21:09:54 -0300 |
commit | a1edbf720620c672566a1681572c3845452ca51a (patch) | |
tree | 9094a71a38d890a0514d88e9add9b522855a3e10 /activesupport/lib | |
parent | 7004434ad85901215e1cb4367b2b8b1e7f9063c7 (diff) | |
download | rails-a1edbf720620c672566a1681572c3845452ca51a.tar.gz rails-a1edbf720620c672566a1681572c3845452ca51a.tar.bz2 rails-a1edbf720620c672566a1681572c3845452ca51a.zip |
parse dates to yaml in json arrays
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/json/backends/yaml.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/json/backends/yaml.rb b/activesupport/lib/active_support/json/backends/yaml.rb index f9d8fd8e83..e25e29d36b 100644 --- a/activesupport/lib/active_support/json/backends/yaml.rb +++ b/activesupport/lib/active_support/json/backends/yaml.rb @@ -29,7 +29,7 @@ module ActiveSupport def convert_json_to_yaml(json) #:nodoc: require 'strscan' unless defined? ::StringScanner scanner, quoting, marks, pos, times = ::StringScanner.new(json), false, [], nil, [] - while scanner.scan_until(/(\\['"]|['":,\\]|\\.)/) + while scanner.scan_until(/(\\['"]|['":,\\]|\\.|[\]])/) case char = scanner[1] when '"', "'" if !quoting @@ -43,7 +43,7 @@ module ActiveSupport end quoting = false end - when ":","," + when ":",",", "]" marks << scanner.pos - 1 unless quoting when "\\" scanner.skip(/\\/) |