* ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).

[Bug #5173] [ruby-core:38866]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2011-08-30 02:23:12 +00:00
parent 2dd9d721ed
commit b14c060dda
13 changed files with 728 additions and 288 deletions

View file

@ -4,21 +4,8 @@ module JSON
# This module holds all the modules/classes that implement JSON's
# functionality as C extensions.
module Ext
begin
if defined?(RUBY_ENGINE) == 'constant' and RUBY_ENGINE == 'ruby' and RUBY_VERSION =~ /\A1\.9\./
require 'json/ext/1.9/parser'
require 'json/ext/1.9/generator'
elsif !defined?(RUBY_ENGINE) && RUBY_VERSION =~ /\A1\.8\./
require 'json/ext/1.8/parser'
require 'json/ext/1.8/generator'
else
require 'json/ext/parser'
require 'json/ext/generator'
end
rescue LoadError
require 'json/ext/parser'
require 'json/ext/generator'
end
require 'json/ext/parser'
require 'json/ext/generator'
$DEBUG and warn "Using Ext extension for JSON."
JSON.parser = Parser
JSON.generator = Generator