diff options
author | Tim Smith <tsmith84@gmail.com> | 2019-12-21 00:27:41 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2019-12-21 00:27:41 -0800 |
commit | 63be9508b745b094aa0226bb57062547e9cf8fb9 (patch) | |
tree | 265ac83193e9a63d65d3698d620d226fb6c7f67b /lib/ffi_yajl.rb | |
parent | dd0232bf6107e64321a36da3348ab8cc8e5046dd (diff) | |
download | ffi-yajl-63be9508b745b094aa0226bb57062547e9cf8fb9.tar.gz |
Substitute require for require_relativerelative
require_relative is significantly faster and should be used when available.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/ffi_yajl.rb')
-rw-r--r-- | lib/ffi_yajl.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ffi_yajl.rb b/lib/ffi_yajl.rb index 1111775..20979a1 100644 --- a/lib/ffi_yajl.rb +++ b/lib/ffi_yajl.rb @@ -35,16 +35,16 @@ # - Then we try the c-ext and rescue into ffi that fails # if ENV["FORCE_FFI_YAJL"] == "ext" - require "ffi_yajl/ext" + require_relative "ffi_yajl/ext" elsif ENV["FORCE_FFI_YAJL"] == "ffi" - require "ffi_yajl/ffi" + require_relative "ffi_yajl/ffi" elsif RUBY_PLATFORM == "java" - require "ffi_yajl/ffi" + require_relative "ffi_yajl/ffi" else begin - require "ffi_yajl/ext" + require_relative "ffi_yajl/ext" rescue LoadError warn "failed to load the ffi-yajl c-extension, falling back to ffi interface" - require "ffi_yajl/ffi" + require_relative "ffi_yajl/ffi" end end |