During development of code it is sometimes useful to test syntax using an interpreter. Depending on what you are developing will depend on which method best suits you. I thought I would run though a couple;
- Chrome Developer Console
- UCS Director interpreter
I'm sure other options exist however these are ones I've found and am finding useful.
It will then launch a window similar to below in Chrome.
You can now enter lines of code into the console interpreter;
The project page can be found here.
To Download Rhino from Github and get up and running on your MAC;
$ curl https://github.com/mozilla/rhino/releases/download/Rhino1_7R5_RELEASE/rhino1_7R5.zip > /tmp/rhino.zip $ cd /tmp $ unzip rhino.zip
A file called 'js.jar' should now exist in the unziped folder. You now need to move this to a folder that Java can use it from. In OSX Java will look for class libraries in '~/Library/Java/Extensions'
mv /tmp/rhino1_7R5/js.jar ~/Library/Java/Extensions/
NOTE: You may need to create the directory if it doesn't exist.
However if you like me and have a terrible memory just create an alias for this (I've decided to use rhino);
Then you can just use the alias;
rhino Rhino 1.7 release 5 2015 01 29 js>
I should note that I used http://www.phpied.com/installing-rhino-on-mac/ as the inspiration to this blog entry.
To make use of all the libraries in UCSD you will need to actually run the CLI interpreter on the UCSD host itself (well thats the quickest and easiest way).
UPDATE2: A customer also had a similar thought to me and it has been documented on the community index site here.
UCS Director interpreter
To launch the Cloupia script interpretor (my understand is Cloupia scripts are based around Rhino) you need to browse to Policies>Orchestration>Custom Workflow Tasks and the select the 'Launch Interpretor' button.
The interpretor window will then appear.