diff options
-rw-r--r-- | ext/ffi_yajl/ext/dlopen/extconf.rb | 1 | ||||
-rw-r--r-- | lib/ffi_yajl/benchmark/encode.rb | 20 | ||||
-rw-r--r-- | lib/ffi_yajl/benchmark/encode_profile.rb | 2 | ||||
-rw-r--r-- | lib/ffi_yajl/benchmark/parse.rb | 12 | ||||
-rw-r--r-- | lib/ffi_yajl/benchmark/parse_profile.rb | 2 | ||||
-rw-r--r-- | lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb | 2 |
6 files changed, 16 insertions, 23 deletions
diff --git a/ext/ffi_yajl/ext/dlopen/extconf.rb b/ext/ffi_yajl/ext/dlopen/extconf.rb index 7e18469..f35d0cb 100644 --- a/ext/ffi_yajl/ext/dlopen/extconf.rb +++ b/ext/ffi_yajl/ext/dlopen/extconf.rb @@ -1,3 +1,4 @@ +# rubocop:disable Style/GlobalVars require 'mkmf' require 'rubygems' diff --git a/lib/ffi_yajl/benchmark/encode.rb b/lib/ffi_yajl/benchmark/encode.rb index eda4fe7..0a33a53 100644 --- a/lib/ffi_yajl/benchmark/encode.rb +++ b/lib/ffi_yajl/benchmark/encode.rb @@ -5,14 +5,10 @@ require 'rubygems' require 'benchmark' require 'stringio' if !defined?(RUBY_ENGINE) || RUBY_ENGINE !~ /jruby/ - if ENV['FORCE_FFI_YAJL'] != 'ext' - begin - require 'yajl' - rescue Exception - puts "INFO: yajl-ruby not installed" - end - else - puts "INFO: skipping yajl-ruby because we're using the C extension" + begin + require 'yajl' + rescue LoadError + puts "INFO: yajl-ruby not installed" end else puts "INFO: skipping yajl-ruby on jruby" @@ -20,22 +16,22 @@ end require 'ffi_yajl' begin require 'json' -rescue Exception +rescue LoadError puts "INFO: json gem not installed" end begin require 'psych' -rescue Exception +rescue LoadError puts "INFO: psych gem not installed" end begin require 'active_support' -rescue Exception +rescue LoadError puts "INFO: active_support gem not installed" end begin require 'oj' -rescue Exception +rescue LoadError puts "INFO: oj gem not installed" end diff --git a/lib/ffi_yajl/benchmark/encode_profile.rb b/lib/ffi_yajl/benchmark/encode_profile.rb index f7ac7c2..d993581 100644 --- a/lib/ffi_yajl/benchmark/encode_profile.rb +++ b/lib/ffi_yajl/benchmark/encode_profile.rb @@ -5,7 +5,7 @@ require 'rubygems' require 'ffi_yajl' begin require 'perftools' -rescue Exception +rescue LoadError puts "INFO: perftools.rb gem not installed" end diff --git a/lib/ffi_yajl/benchmark/parse.rb b/lib/ffi_yajl/benchmark/parse.rb index 7e1f3a6..0625e33 100644 --- a/lib/ffi_yajl/benchmark/parse.rb +++ b/lib/ffi_yajl/benchmark/parse.rb @@ -4,14 +4,10 @@ require 'yaml' require 'yajl' require 'ffi_yajl' if !defined?(RUBY_ENGINE) || RUBY_ENGINE !~ /jruby/ - if ENV['FORCE_FFI_YAJL'] != 'ext' - begin - require 'yajl' - rescue Exception - puts "INFO: yajl-ruby not installed" - end - else - puts "INFO: skipping yajl-ruby because we're using the C extension" + begin + require 'yajl' + rescue LoadError + puts "INFO: yajl-ruby not installed" end else puts "INFO: skipping yajl-ruby on jruby" diff --git a/lib/ffi_yajl/benchmark/parse_profile.rb b/lib/ffi_yajl/benchmark/parse_profile.rb index 39343bc..dfcbc01 100644 --- a/lib/ffi_yajl/benchmark/parse_profile.rb +++ b/lib/ffi_yajl/benchmark/parse_profile.rb @@ -5,7 +5,7 @@ require 'rubygems' require 'ffi_yajl' begin require 'perftools' -rescue Exception +rescue LoadError puts "INFO: perftools.rb gem not installed" end diff --git a/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb b/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb index 8d9dd5d..db72e45 100644 --- a/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb +++ b/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb @@ -10,7 +10,7 @@ module FFI_Yajl def run begin require 'ruby-prof' - rescue Exception + rescue LoadError puts "INFO: perftools.rb gem not installed" end |