3

Server/Client are the same box. Creating a UI to run ruby test scripts locally.

I want something like executing an ActiveXObject:

    w = new ActiveXObject("WScript.Shell");
    w.run('test.rb');

File structure is as follows

>Project
  -index.HTML
  -custom.js
  >Scripts
   -Ruby Script
4
  • what exactly is your question? please be more specific. Commented Mar 19, 2012 at 16:19
  • w.run('Scripts/test.rb'); ? Commented Mar 19, 2012 at 16:19
  • I want to execute a ruby script with a JavaScript function. ActiveXObject isn't able to execute a ruby file. Commented Mar 19, 2012 at 16:26
  • "Breaking on JScript runtime Error -(n" Commented Mar 19, 2012 at 16:38

1 Answer 1

3

Assuming ruby is installed in the system and is included in the PATH variable. All you need to do is:

var w = new ActiveXObject("WScript.Shell");
w.run('ruby Scripts\\test.rb');
Sign up to request clarification or add additional context in comments.

1 Comment

Making some progress here - although what happens now is a Ruby terminal is briefly opened and closed, but nothing else happens.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.