ruby-rice / rice

Ruby Interface for C++ Extensions
http://ruby-rice.github.io/
Other
378 stars 63 forks source link

Correctly initialize embedded Ruby interpreter. #137

Closed cfis closed 3 years ago

cfis commented 3 years ago

Embedding ruby requires more than just calling ruby_init - that always leads to exceptions on windows since ruby_sysinit is not called. This patch updates Ruby to be correctly initialized for tests. It also makes sure Ruby is only initialized once.

jasonroelofs commented 3 years ago

Thanks! Curious, what are you using Rice for?

cfis commented 3 years ago

I'm currently wrapping our company's core C++ engine using PyBind11 - which has worked really well. Very impressive library.

Having done a lot of Ruby work previously I was curious how hard it would be to do the same in Ruby. I vaguely knew about Rice and decided to give it a try in me free time. It also is a good way for me to improve my C++ metaprogramming skills (I've been working on updating the wrapper function code but keep coming up with better ways of doing it as I learn more).

jasonroelofs commented 3 years ago

Awesome. The contributions you're making are appreciated, thanks for modernizing some of this!