Forum Discussion

Kenzo's avatar
Kenzo
Occasional Contributor
17 years ago

parameter passing

Hi all,

so I have a datasource test step in which I retrieve an URL from the database.
In the next step I have a groovy script like so:

def URL = context.expand( '${DataSource#URL}' )
java.lang.Runtime a = java.lang.Runtime.getRuntime();
java.lang.Process b = a.exec("ruby C:\\ruby\\test.rb ");
Thread.sleep(30000);

As you can see I am getting the URL from the previous step and call the ruby script test.rb. However, what I really want to do is pass URL to the ruby script as a parameter but I don't know how to. Can any body share the sample codes to:

1- pass a parameter in groovy when calling a ruby script
2- get the parameter in ruby

thanks in advance
No RepliesBe the first to reply