Run external ruby script from contoller


#1

I have an already existing ruby script that will interface with the
del.icio.us api. I’m putting together a rails app and would like to use
this already existing ruby script for several reasons.

My question is how to call this ruby script from within my controller?

I simply want to call the script, pass it a few parameters and then
proceed onto my next statement, so the script executes as its own
process and the controller action continues executing whether or not the
script execution was successful.

anyone done this before?


#2

Let me somewhat rephrase the question (although I still would like to
know the answer to my original question).

The more I think about it the more I want to keep the processing in a
rails controller simply for the fact that I have all the database and
model info existing.

So, how would I pass processing within a controller action to another
controller action without waiting for the second action to finish.

i.e.

def process_request
go_perform_other_process #(process but don’t wait for completion
before continuing)
do rest of action routine
end


#3

Hi,

How did you do it finally ?

Craig J. wrote:

Let me somewhat rephrase the question (although I still would like to
know the answer to my original question).

The more I think about it the more I want to keep the processing in a
rails controller simply for the fact that I have all the database and
model info existing.

So, how would I pass processing within a controller action to another
controller action without waiting for the second action to finish.

i.e.

def process_request
go_perform_other_process #(process but don’t wait for completion
before continuing)
do rest of action routine
end


#4

Check out BackgrounDRb – http://backgroundrb.rubyforge.org/.