summaryrefslogtreecommitdiff
path: root/lib/ffi_yajl/ffi.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-08-17 10:51:14 -0700
committerGitHub <noreply@github.com>2020-08-17 10:51:14 -0700
commit160f13b5bcc7d83b0894fdbd1a72930d2a0c984b (patch)
tree37bd9071a5e3e05aae8e2eb9922e0d1eea1b3a7f /lib/ffi_yajl/ffi.rb
parenta2d57217674d80308a4efb934e08762c4c253ad9 (diff)
parent9c20d1aaa25fc4058c337f5e8ceb3755839f49b2 (diff)
downloadffi-yajl-160f13b5bcc7d83b0894fdbd1a72930d2a0c984b.tar.gz
Merge pull request #109 from chef/requires
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/ffi_yajl/ffi.rb')
-rw-r--r--lib/ffi_yajl/ffi.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ffi_yajl/ffi.rb b/lib/ffi_yajl/ffi.rb
index c6601f0..28fcc79 100644
--- a/lib/ffi_yajl/ffi.rb
+++ b/lib/ffi_yajl/ffi.rb
@@ -20,11 +20,11 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-require "rubygems"
+require "rubygems" unless defined?(Gem)
require "libyajl2"
begin
- require "ffi"
+ require "ffi" unless defined?(FFI)
rescue LoadError
$stderr.puts "FATAL: to use the ffi extension instead of the compiled C extension, the ffi gem must be installed"
$stderr.puts " (it is optional, so you must include it in your bundle manually)"