Page 1 of 1

Accessing a Ruby File with a RevLet

Posted: Thu Oct 01, 2009 3:45 pm
by TheBigDuck
I have a Ruby script that does some special stuff and I want to pass it some parameters.

The revlet is hosted on my server.

In a regular application, I pass data to the Ruby script via shell, but this fails in revlet.

Shell scripts do not work. trying "shell ('pwd') in debug works, but when deployed, gives you nothing.

Even if I copy the file.. how can I access it? How can I send it data and get it back?

Posted: Thu Oct 01, 2009 4:55 pm
by Janschenkel
You'll have to ask for access to the Shell for your revlet.
In the Standalone Applications Settings window, go to the Web panel, switch Security from Auto-detect to Use these settings and tick the Shell checkbox.
When you build and test your revlet, it will ask permission for this revlet to access the Shell. Grant it, and your ruby script ought to work (on the condition that there is a Ruby interpeter, of course)

HTH,

Jan Schenkel.

Close, but no cigar yet

Posted: Fri Oct 02, 2009 4:32 pm
by TheBigDuck
the shell command looks here

Code: Select all

shell("pwd")
which gives the local directory returns this:

/Users/hbeck/Library/Application Support/RunRev/revWebPlayer

This doesn't work for me, because the Ruby script is hosted on the server.

I need to send list of parameters to Ruby and get them back.

All the Ruby magic must happen on the server side.

Is there some way of doing this with revMedia?

Also, I have revStudio 3.5 and I don't understand the relationship between revMedia and my revStudio.

Why can't I make a Web Application with revStudio 3.5 directly?

Posted: Fri Oct 02, 2009 4:59 pm
by mwieder
Why can't I make a Web Application with revStudio 3.5 directly?
You'll have to wait for 4.0 to do that...

Posted: Sat Oct 03, 2009 12:35 pm
by Janschenkel
If the Ruby script is running on the server, try using a GET or POST to the server as if it were a web app.

Jan Schenkel.