summaryrefslogtreecommitdiff
path: root/lib/json/ext.rb
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-07-24 23:48:59 +0200
committerFlorian Frank <flori@ping.de>2011-07-24 23:59:40 +0200
commit6f6eeb049090017556aa80f84c6c68f29bd0f7d3 (patch)
tree406d235453d2b4ca348852f3e42c0a949df8d471 /lib/json/ext.rb
parentf7f78896607b6f6226cdee4ae76de922d4583d32 (diff)
downloadjson-6f6eeb049090017556aa80f84c6c68f29bd0f7d3.tar.gz
Oh, look loading the extension is much easier now
Diffstat (limited to 'lib/json/ext.rb')
-rw-r--r--lib/json/ext.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/json/ext.rb b/lib/json/ext.rb
index 1fbc3fd..7264a85 100644
--- a/lib/json/ext.rb
+++ b/lib/json/ext.rb
@@ -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