Discussion:
How to use another script for input.
Ken D'Ambrosio
2018-12-06 02:08:16 UTC
Permalink
Hey, all. I've written a script that does a bunch of OpenStack API
stuff. Yay. But now I'm writing a CGI front-end, and I'd like to use
the first script to inform the new one, so to speak. I assume I have to
do classes in the "back-end" script, and then access them from the CGI
script.

I have no idea how to make this happen, aside from the fact that
"require" is probably involved.

Can someone point me to a site that could help me figure that out?

Thanks!

-Ken

Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
Greg Navis
2018-12-06 08:26:28 UTC
Permalink
Hi!

It's hard to make specific recommendations without seeing the script but
you have at least two options:

1. Call "require 'your-script-name'" and use the API from within the CGI
app.
2. Call your script as a standalone script via fork/exec.

Best regards
Greg Navis

Loading...