diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | json.gemspec | 4 | ||||
-rw-r--r-- | json_pure.gemspec | 4 | ||||
-rw-r--r-- | lib/json/common.rb | 3 | ||||
-rw-r--r-- | lib/json/version.rb | 2 | ||||
-rwxr-xr-x | tests/test_json.rb | 1 |
7 files changed, 12 insertions, 7 deletions
@@ -1,3 +1,6 @@ +2011-12-01 (1.6.3) + * Let JSON.load('') return nil as well to make mysql text columns (default to + '') work better for serialization. 2011-11-21 (1.6.2) * Add support for OpenStruct and BigDecimal. * Fix bug when parsing nil in quirks_mode. @@ -1 +1 @@ -1.6.2 +1.6.3 diff --git a/json.gemspec b/json.gemspec index 87878e8..205757e 100644 --- a/json.gemspec +++ b/json.gemspec @@ -2,11 +2,11 @@ Gem::Specification.new do |s| s.name = "json" - s.version = "1.6.2" + s.version = "1.6.3" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Florian Frank"] - s.date = "2011-11-28" + s.date = "2011-12-01" s.description = "This is a JSON implementation as a Ruby extension in C." s.email = "flori@ping.de" s.extensions = ["ext/json/ext/generator/extconf.rb", "ext/json/ext/parser/extconf.rb"] diff --git a/json_pure.gemspec b/json_pure.gemspec index f169dbf..3bdb216 100644 --- a/json_pure.gemspec +++ b/json_pure.gemspec @@ -2,11 +2,11 @@ Gem::Specification.new do |s| s.name = "json_pure" - s.version = "1.6.2" + s.version = "1.6.3" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Florian Frank"] - s.date = "2011-11-28" + s.date = "2011-12-01" s.description = "This is a JSON implementation in pure Ruby." s.email = "flori@ping.de" s.extra_rdoc_files = ["README.rdoc"] diff --git a/lib/json/common.rb b/lib/json/common.rb index fcb1f82..cf7a8b9 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -313,7 +313,8 @@ module JSON source = source.to_io.read elsif source.respond_to?(:read) source = source.read - elsif source.nil? && opts[:quirks_mode] + end + if opts[:quirks_mode] && (source.nil? || source.empty?) source = 'null' end result = parse(source, opts) diff --git a/lib/json/version.rb b/lib/json/version.rb index ee9a95a..9272c53 100644 --- a/lib/json/version.rb +++ b/lib/json/version.rb @@ -1,6 +1,6 @@ module JSON # JSON version - VERSION = '1.6.2' + VERSION = '1.6.3' VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc: VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc: VERSION_MINOR = VERSION_ARRAY[1] # :nodoc: diff --git a/tests/test_json.rb b/tests/test_json.rb index 40774b3..c308933 100755 --- a/tests/test_json.rb +++ b/tests/test_json.rb @@ -427,6 +427,7 @@ EOT stringio.rewind assert_equal @hash, JSON.load(stringio) assert_equal nil, JSON.load(nil) + assert_equal nil, JSON.load('') end def test_dump |