/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. */
  5. package razie.scripting
  6. import com.razie.pub.base._
  7. /** add capability to support scala scripts */
  8. class ScriptFactoryScala (val other:ScriptFactory, val dflt:Boolean) extends ScriptFactory {
  9. override def makeImpl (lang:String, s:String) = {
  10. (lang, dflt) match {
  11. case ("scala", _) | (null, true) => new ScriptScala(s)
  12. case _ => other.makeImpl (lang, s)
  13. }
  14. }
  15. }