unmuse
unmuse

Reputation: 687

JavaScript Execute Ruby Script

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

Upvotes: 3

Views: 3589

Answers (1)

Roland Mai
Roland Mai

Reputation: 31097

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');

Upvotes: 3

Related Questions