forked from databricks/tensorframes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREPL.scala
More file actions
44 lines (37 loc) · 1.2 KB
/
REPL.scala
File metadata and controls
44 lines (37 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Build Ammonite type REPL with custom configurations
* Use this class to interactively work with the project
*/
package com.databricks.phi9t.repl
import java.io.{File, InputStream, OutputStream}
import ammonite.interp.Interpreter
import ammonite.ops._
import ammonite.runtime.{History, Storage}
import ammonite.{Main => AmmReplMain}
import ammonite.main.Defaults
import ammonite.repl.{Repl, ReplApiImpl, SessionApiImpl}
import ammonite.util._
import ammonite.util.Util.newLine
object ReplMain extends App {
val welcomeBanner = {
def ammoniteVersion = ammonite.Constants.version
def scalaVersion = scala.util.Properties.versionNumberString
def javaVersion = System.getProperty("java.version")
Util.normalizeNewlines(
s"""tensorframes databricks (amm $ammoniteVersion)
|(Scala $scalaVersion, Java $javaVersion)""".stripMargin
)
}
val predef = """
|repl.prompt() = "scala> ";
|repl.frontEnd() = ammonite.repl.FrontEnd.JLineUnix;
|repl.colors() = ammonite.util.Colors.BlackWhite;
""".stripMargin
val replMain = AmmReplMain(
predef = predef,
defaultPredef = false,
remoteLogging = false,
welcomeBanner = Some(welcomeBanner)
)
replMain.run()
}