summaryrefslogtreecommitdiff
path: root/lib/ffi_yajl/benchmark/encode.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ffi_yajl/benchmark/encode.rb')
-rw-r--r--lib/ffi_yajl/benchmark/encode.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ffi_yajl/benchmark/encode.rb b/lib/ffi_yajl/benchmark/encode.rb
index 81c1d26..dfab9ea 100644
--- a/lib/ffi_yajl/benchmark/encode.rb
+++ b/lib/ffi_yajl/benchmark/encode.rb
@@ -1,9 +1,9 @@
# Portions Originally Copyright (c) 2008-2011 Brian Lopez - http://github.com/brianmario
# See MIT-LICENSE
-require "rubygems"
-require "benchmark"
-require "stringio"
+require "rubygems" unless defined?(Gem)
+require "benchmark" unless defined?(Benchmark)
+require "stringio" unless defined?(StringIO)
if !defined?(RUBY_ENGINE) || RUBY_ENGINE !~ /jruby/
begin
require "yajl"
@@ -15,7 +15,7 @@ else
end
require_relative "../../ffi_yajl"
begin
- require "json"
+ require "json" unless defined?(JSON)
rescue LoadError
puts "INFO: json gem not installed"
end