benchmark/encode.rb in yajl-ruby-0.7.6 vs benchmark/encode.rb in yajl-ruby-0.7.7
- old
+ new
@@ -1,21 +1,19 @@
# encoding: UTF-8
+$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/..')
+
require 'rubygems'
require 'benchmark'
require 'yajl_ext'
require 'stringio'
begin
require 'json'
rescue LoadError
end
# Can't use ActiveSuport::JSON.encode with the JSON gem loaded
# begin
-# require 'active_support/json'
+# require 'active_support'
# rescue LoadError
-# begin
-# require 'active_support'
-# rescue LoadError
-# end
# end
filename = ARGV[0] || 'benchmark/subjects/ohai.json'
json = File.new(filename, 'r')
hash = Yajl::Parser.new.parse(json)