PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/scripster/src/razie/scripting/ScriptFactoryScala.scala

http://razpub.googlecode.com/
Scala | 18 lines | 10 code | 3 blank | 5 comment | 0 complexity | 2bd15da2caeaca4973591c77dfdff019 MD5 | raw file
 1/**
 2 * Razvan's public code. Copyright 2008 based on Apache license (share alike) see LICENSE.txt for
 3 * details. No warranty implied nor any liability assumed for this code.
 4 */
 5package razie.scripting
 6
 7import com.razie.pub.base._
 8
 9/** add capability to support scala scripts */
10class ScriptFactoryScala (val other:ScriptFactory, val dflt:Boolean) extends ScriptFactory {
11
12   override def makeImpl (lang:String, s:String) = {
13      (lang, dflt) match {
14         case ("scala", _) | (null, true) => new ScriptScala(s)
15         case _ => other.makeImpl (lang, s)
16      }
17   }
18}