Example in readme doesn't seem to work, has formatting errors
Firstly, README.md has several extra closing parentheses which render it invalid ruby. Both the ))) need to be changed to )).
More importantly, it fails to run. Here's my output trying to run the (corrected) example:
irb(main):024:1* env.evaluate(
irb(main):025:1* ast,
irb(main):026:1* name: Cel::String.new("/groups/acme.co/documents/secret-stuff"),
irb(main):027:1* group: Cel::String.new("acme.co")
irb(main):028:0> )
/Users/james/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/cel-0.2.0/lib/cel/ast/elements.rb:238:in `start_with?': no implicit conversion of Cel::Operation into String (TypeError)
Bool.new(@value.start_with?(string))
^^^^^^
from /Users/james/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/cel-0.2.0/lib/cel/ast/elements.rb:238:in `startsWith'
from /Users/james/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/cel-0.2.0/lib/cel/program.rb:96:in `public_send'
from /Users/james/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/cel-0.2.0/lib/cel/program.rb:96:in `evaluate_invoke'
from /Users/james/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/cel-0.2.0/lib/cel/program.rb:14:in `evaluate'
from /Users/james/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/cel-0.2.0/lib/cel/environment.rb:42:in `evaluate'
from (irb):24:in `<main>'
from /Users/james/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>'
from /Users/james/.rbenv/versions/3.2.1/bin/irb:25:in `load'
from /Users/james/.rbenv/versions/3.2.1/bin/irb:25:in `<main>'
Not sure what's wrong there, I have it working with simpler operations, but FYI.
Edited by James Tippett