How do I communicate with a shoes app spawned by a ruby app

I am attempting to pass data back from a shoes app that was spawned by a ruby app. Doing simple stuff like present a list of file names in the shoes app for the user to select what is to be deleted. Then want to pass this information back to the spawning ruby app. Only easy way I can see setup communications between the two is to read and write files.
Have tried a admin environment variable and popen neither work in this situation.

If I had a debug version of shoes might consider doing everything in shoes!

Ruby version is 2.5.5p157 Shoes 3.2.25r2170 running Windows 10 20H2

Does anyone have any suggestions other than using files.

Also seem to be able to do anything I want with this version of shoes, any reason to change to a newer version (if one is available - no longer remember why I chose this version).

If you use command line to spawn the app, just use arguments. I build various Ruby2D games that way, which spawns app in a Thread.

For example:

Thread.new { system("ruby #{File.join(__dir__, 'loginApp.rb')} #{username} #{encrypted_password}") }

On the loginApp.rb, you have to make sure the app aborts with a message if a user launches it without any argument.

In the past, I have also build one Java AWT app (Yes, I hate it) that way, just for my college project. Which worked reliably on Linux / Unix… Which obviously spawned Java app. But you can also switch the language here because it has no relation with the spawned app. And this can be done with any programming language that supports such stuff…

Rather than passing variables to shoes (can create rb file on fly) I need to get return values from shoes. Looking at using backtick command and processing stdout or something simulator. Works in standard ruby but not shoes, just starting to explore several options. Was just hoping someone may have done this before.

Whatever I try that works with a standard spawned ruby app does not work with shoes. So will either redirected stdout to a file and simply use puts to log or have a common file which is read by the shoes app for any parameters I may want to pass and then use to the same file to pass back any output.

Thanks for your help!
P.S. Still open to suggerstions

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs