This introduces a few changes/fixes for the ruby bindings. While the process for building and installing the gem locally was working, I ran into some issues in another project when trying to use bundler to build the gem from the remote git source for me. I've verified these changes address those issues.
since building the gem appears to copy the Cargo.toml and Cargo.lock files before attempting to build native extensions on the host, this fails with relative paths to regorus from regorusrb. I think this might eventually be solvable with more advanced build scripts for the ruby gem, or would eventually be solved if the gem ends up built/published as part of regorus CI and includes pre-compiled binaries for distribution. In the meantime, I'm addressing this by pointing regorusrb to depend on regorus = { git = "https://github.com/microsoft/regorus" }
related to above, change bindings/ruby/LICENSE.txt from a symlink to a copy of LICENSE
Update bindings/ruby/README.md to indicate the ruby gem name is regorusrb, remove bundle add command until glob option is supported, add instructions for building and installing the rubygem from source
require 'rb-sys' in gemspec for building the gem, specify extension through extconf.rb, which will auto-install the rust toolchain if not present. Also include rake-compiler-rust gem when building and developing locally, which allows cross-compiling for different architectures, i.e. rake 'native[x86_64-linux]'
change the output location for dynamic libraries from bindings/ruby/regorusrb/regorusb.so (or appropriate file extension) to bindings/ruby/regorus/regorusrb.so. This is more in keeping with the ruby module/namespace Regorus, while allowing referencing the dynamice library regorusrb distinctly from the regorus ruby code, which is uesful to avoid ambiguous require and require_relative statements in ruby
add Regorus::Engine#eval_bool_query(), #eval_allow_query, and #eval_deny_query methods
This introduces a few changes/fixes for the ruby bindings. While the process for building and installing the gem locally was working, I ran into some issues in another project when trying to use
bundler
to build the gem from the remote git source for me. I've verified these changes address those issues.regorus
fromregorusrb
. I think this might eventually be solvable with more advanced build scripts for the ruby gem, or would eventually be solved if the gem ends up built/published as part of regorus CI and includes pre-compiled binaries for distribution. In the meantime, I'm addressing this by pointingregorusrb
to depend onregorus = { git = "https://github.com/microsoft/regorus" }
bindings/ruby/LICENSE.txt
from a symlink to a copy ofLICENSE
bindings/ruby/README.md
to indicate the ruby gem name isregorusrb
, removebundle add
command until glob option is supported, add instructions for building and installing the rubygem from sourceextconf.rb
, which will auto-install the rust toolchain if not present. Also includerake-compiler-rust
gem when building and developing locally, which allows cross-compiling for different architectures, i.e.rake 'native[x86_64-linux]'
bindings/ruby/regorusrb/regorusb.so
(or appropriate file extension) tobindings/ruby/regorus/regorusrb.so
. This is more in keeping with the ruby module/namespaceRegorus
, while allowing referencing the dynamice libraryregorusrb
distinctly from theregorus
ruby code, which is uesful to avoid ambiguousrequire
andrequire_relative
statements in rubyRegorus::Engine#eval_bool_query()
,#eval_allow_query
, and#eval_deny_query
methods