summaryrefslogtreecommitdiff
path: root/lib/ffi_yajl/benchmark/encode.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-06-20 15:37:38 -0700
committerTim Smith <tsmith@chef.io>2017-06-20 15:37:38 -0700
commit672fce3aed2d68e7362dc5cfeb72df78f30eb3a2 (patch)
tree76598d0c31493ca6fa8a8353402136cf8003b997 /lib/ffi_yajl/benchmark/encode.rb
parentf3f92275f804f4c6cf93ee054af7d4ba3e50030a (diff)
downloadffi-yajl-672fce3aed2d68e7362dc5cfeb72df78f30eb3a2.tar.gz
Switch from reek/rubocop to chefstyle
Reek doesn't work with modern Rake Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/ffi_yajl/benchmark/encode.rb')
-rw-r--r--lib/ffi_yajl/benchmark/encode.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ffi_yajl/benchmark/encode.rb b/lib/ffi_yajl/benchmark/encode.rb
index fc03c06..17e12cc 100644
--- a/lib/ffi_yajl/benchmark/encode.rb
+++ b/lib/ffi_yajl/benchmark/encode.rb
@@ -1,26 +1,26 @@
# Portions Originally Copyright (c) 2008-2011 Brian Lopez - http://github.com/brianmario
# See MIT-LICENSE
-require 'rubygems'
-require 'benchmark'
-require 'stringio'
+require "rubygems"
+require "benchmark"
+require "stringio"
if !defined?(RUBY_ENGINE) || RUBY_ENGINE !~ /jruby/
begin
- require 'yajl'
+ require "yajl"
rescue LoadError
puts "INFO: yajl-ruby not installed"
end
else
puts "INFO: skipping yajl-ruby on jruby"
end
-require 'ffi_yajl'
+require "ffi_yajl"
begin
- require 'json'
+ require "json"
rescue LoadError
puts "INFO: json gem not installed"
end
begin
- require 'oj'
+ require "oj"
rescue LoadError
puts "INFO: oj gem not installed"
end
@@ -31,7 +31,7 @@ module FFI_Yajl
def run
# filename = ARGV[0] || 'benchmark/subjects/ohai.json'
filename = File.expand_path(File.join(File.dirname(__FILE__), "subjects", "ohai.json"))
- hash = File.open(filename, 'rb') { |f| FFI_Yajl::Parser.parse(f.read) }
+ hash = File.open(filename, "rb") { |f| FFI_Yajl::Parser.parse(f.read) }
times = ARGV[1] ? ARGV[1].to_i : 1000
puts "Starting benchmark encoding #{filename} #{times} times\n\n"