Accessing a Ruby File with a RevLet

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
TheBigDuck
Posts: 23
Joined: Tue Nov 11, 2008 5:52 pm
Contact:

Accessing a Ruby File with a RevLet

Post by TheBigDuck » Thu Oct 01, 2009 3:45 pm

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?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Oct 01, 2009 4:55 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

TheBigDuck
Posts: 23
Joined: Tue Nov 11, 2008 5:52 pm
Contact:

Close, but no cigar yet

Post by TheBigDuck » Fri Oct 02, 2009 4:32 pm

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?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Fri Oct 02, 2009 4:59 pm

Why can't I make a Web Application with revStudio 3.5 directly?
You'll have to wait for 4.0 to do that...

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Sat Oct 03, 2009 12:35 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply