From Torsten at robitzki.de Thu Jul 19 08:09:26 2012 From: Torsten at robitzki.de (Torsten@Robitzki.de) Date: Thu, 19 Jul 2012 10:09:26 +0200 Subject: [Rake-devel] JSON.parse string Message-ID: <3B98AEF6-F47C-4D08-ABFE-0F739F0E4B23@robitzki.de> Hello, I just stumbled over the fact, that the JSON parser from ruby 1.9.2 allows only arrays and objects: > a = JSON.parse '"fooo"' JSON::ParserError: 710: unexpected token at '"fooo"' > a = JSON.parse "[\"a\"]" => ["a"] As a workaround, I can wrap every text into an array and take the first element of the result: JSON.parse( "[#{a}]" )[ 0 ] But I wonder if this is the intended behavior and if so, why? Kind regards Torsten