I've got a Ruby program that collects data into a friendly json format. I then pass that data into a python script by calling
`python3 py_script.py #{my_data}`
from the Ruby code.
This works well when running the Ruby script from the same directory as the python script. In short I'd love to pack this into a gem but after bundling and installing the gem, when I try to run it Ruby searches for the python file relative to where the current path of the shell is, and not from the structure specified in the gemspec, which is exactly what it does when just running the Ruby script directly.
I'm new to Ruby so this is entirely unexpected behavior. Is there a simple way to make this work? Or perhaps another method that I've just missed in my search?
For what it's worth I have tried several methods of calling the python script, using
exec, Process.spawn, open3, system, etc.