package com.semperos.screwdriver.js.coffeescript;

import com.semperos.screwdriver.js.RhinoCompiler;
import com.semperos.screwdriver.js.RhinoEvaluator;
import com.semperos.screwdriver.js.RhinoEvaluatorException;

import java.io.IOException;
import java.util.HashMap;

/**
 * Compile CoffeeScript via Rhino
 */
public class CoffeeScriptCompiler {
    private RhinoCompiler eva;

    public CoffeeScriptCompiler() {
        eva = new RhinoCompiler();
        HashMap<String,String> deps = new HashMap<String,String>();
        deps.put("coffee-script.js", "com/semperos/screwdriver/js/vendor/coffee-script-1.4.0.js");
        eva.addDependencies(deps);
    }

    /**
     * Compile CoffeeScript to JavaScript
     *
     * @param coffeeScriptSource The CoffeeScript source code to be compiled
     * @return The resultant JavaScript
     * @throws CoffeeScriptCompileException
     */
    public String compile(String coffeeScriptSource) throws IOException, RhinoEvaluatorException {
        eva.registerCompiler("CoffeeScriptCompiler", "com/semperos/screwdriver/js/extension/compile-coffeescript.js");
        eva.compilerArgs(coffeeScriptSource);
        return eva.compile();
    }
}

@@ -98,59 +98,8 @@
 er;%0A
-import com.semperos.screwdriver.js.RhinoEvaluator;%0A
 impo
@@ -314,19 +314,29 @@
 ompiler 
-eva
+rhinoCompiler
 ;%0A%0A    p
@@ -374,19 +374,29 @@
         
-eva
+rhinoCompiler
  = new R
@@ -586,19 +586,29 @@
         
-eva
+rhinoCompiler
 .addDepe
@@ -963,19 +963,29 @@
         
-eva
+rhinoCompiler
 .registe
@@ -1092,19 +1092,29 @@
         
-eva
+rhinoCompiler
 .compile
@@ -1159,11 +1159,21 @@
 urn 
-eva
+rhinoCompiler
 .com

Rename field