diff --git a/expression-ruby/Rakefile b/expression-ruby/Rakefile index 45da191..d9b45e0 100644 --- a/expression-ruby/Rakefile +++ b/expression-ruby/Rakefile @@ -1,6 +1,10 @@ # frozen_string_literal: true require 'rb_sys/extensiontask' +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' + +RSpec::Core::RakeTask.new(:spec) GEMSPEC = Gem::Specification.load('lago-expression.gemspec') diff --git a/expression-ruby/ext/lago_expression/src/lib.rs b/expression-ruby/ext/lago_expression/src/lib.rs index 38783af..8669b93 100644 --- a/expression-ruby/ext/lago_expression/src/lib.rs +++ b/expression-ruby/ext/lago_expression/src/lib.rs @@ -43,13 +43,15 @@ fn evaluate( #[magnus::init] fn init(ruby: &Ruby) -> Result<(), Error> { - let class = ruby.define_class("ExpressionParser", ruby.class_object())?; + let module = ruby.define_module("Lago")?; + + let class = module.define_class("ExpressionParser", ruby.class_object())?; class.define_singleton_method("parse", function!(parse, 1))?; - let class = ruby.define_class("Expression", ruby.class_object())?; + let class = module.define_class("Expression", ruby.class_object())?; class.define_method("evaluate", method!(evaluate, 1))?; - let class = ruby.define_class("Event", ruby.class_object())?; + let class = module.define_class("Event", ruby.class_object())?; class.define_singleton_method("new", function!(EventWrapper::new, 3))?; Ok(()) diff --git a/expression-ruby/lago-expression.gemspec b/expression-ruby/lago-expression.gemspec index 851c6d1..4a8d2e8 100644 --- a/expression-ruby/lago-expression.gemspec +++ b/expression-ruby/lago-expression.gemspec @@ -10,4 +10,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'libclang', '~> 14' spec.add_development_dependency 'rake-compiler', '~> 1.2' spec.add_development_dependency 'rb_sys', '~> 0.9' + spec.add_development_dependency 'rspec', '~> 3' end