activelylazy/Rescripter — pull request #6 by codecop (2011-11-19 19:30:17+00:00)
Title: Change test plugin to a fragment (and some ideas to discuss)

Hi David,
most likely you are busy now, but I started doing some work on Rescripter again. Take your time...

The first thing is that I changed the test plugin to be a fragment of the editor plugin. This removed the need to expose internals by exporting it and to require anything but the test dependencies. A small thing. And then, as usual, I removed some warnings in the code (I have a reputation to keep ;-)

This is just the start. I was thinking about some things. Rescripter is in fact 3 things
1) general JS invoker from Eclipse
2) AST exposure to scripts
3) Jasmine Test executor and result display

ad 1)
I thought about generalizing the invioker - as I'm more into Ruby, why not provide the same function to JRuby. First step would be to use the javax.script to call Rhino. I did this on a prototype, because I wanted to do some BDD Prime Factors Code Kata with Jasmine. This works and is not that much work. The only drawback is that javax.script does not offer me a way to provide the script as argument, so the error messages get less meaningful. Next would be to reimplement the system.rs files in Java, so they are available to all scripting languages. Then it should work with JRuby.

ad 3)
I don't know how, but if we factor out the Jasmine test execution and result reporting Java and JavaScript into a separate module, this might be interesting to the Jasmine community. (I hadn't known Jasmine, but after some experiments and trying to implement my own reporter I have to say, it's cooool. See https://bitbucket.org/pkofler/js-katas/src/tip/lib) I will not do that in my katas project, more likely I do a Jasmine-Ant integration. One would also have to separate the runner from the Jasmine specific logic so people could choose: scriptrunner + rhino + jasmine. Whereas a jruby user would select scriptrunner + jruby + rescriptor (AST). Then Jasmine would be integrated in the plugin's globals and would not have to be copied into every project/demo project.

What do you think about that?

Regards, Peter