From 4f8f2fa42c627dccab150d3bc6fbdae3d312efbc Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 28 Dec 2022 03:30:54 +0900 Subject: [PATCH] Load C extension with require_relative (#301) --- lib/ox.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ox.rb b/lib/ox.rb index 015975a1..750752f6 100644 --- a/lib/ox.rb +++ b/lib/ox.rb @@ -76,4 +76,9 @@ module Ox require 'ox/bag' require 'ox/sax' -require 'ox/ox' # C extension +# C extension +begin + require_relative 'ox.so' +rescue LoadError + require 'ox/ox' +end