case class Main(predef: String = "", defaultPredef: Boolean = true, storageBackend: Storage = ..., wd: Path = ammonite.ops.pwd, welcomeBanner: Option[String] = Some(Defaults.welcomeBanner), inputStream: InputStream = System.in, outputStream: OutputStream = System.out, errorStream: OutputStream = System.err, verboseOutput: Boolean = true) extends Product with Serializable
Contains the various entry points to the Ammonite REPL.
Configuration of the basic REPL is done by passing in arguments when constructing the Main instance, and the various entrypoints such as run runScript and so on are methods on that instance.
It is more or less equivalent to the ammonite.main.Repl object itself, and has a similar set of parameters, but does not have any of the ammonite.main.Repl's implementation-related code and provides a more convenient set of entry-points that a user can call.
Note that the instantiateRepl function generates a new Repl every time it is called!
- predef
Any additional code you want to run before the REPL session starts. Can contain multiple blocks separated by
@
s- defaultPredef
Do you want to include the "standard" predef imports provided by Ammonite? These include tools like
time
,grep
, the|
or|?
pipes from ammonite-ops, and other helpers. Can be disabled to give a clean namespace for you to fill using your own predef.- storageBackend
Where will all of Ammonite's persistent data get stored? Things like any
predef.sc
file, compilation/ivy caches, etc.. Defaults include Storage.Folder and Storage.InMemory, though you can create your own.- wd
The working directory of the REPL; when it load scripts, where the scripts will be considered relative to when assigning them packages
- Alphabetic
- By Inheritance
- Main
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Main(predef: String = "", defaultPredef: Boolean = true, storageBackend: Storage = ..., wd: Path = ammonite.ops.pwd, welcomeBanner: Option[String] = Some(Defaults.welcomeBanner), inputStream: InputStream = System.in, outputStream: OutputStream = System.out, errorStream: OutputStream = System.err, verboseOutput: Boolean = true)
- predef
Any additional code you want to run before the REPL session starts. Can contain multiple blocks separated by
@
s- defaultPredef
Do you want to include the "standard" predef imports provided by Ammonite? These include tools like
time
,grep
, the|
or|?
pipes from ammonite-ops, and other helpers. Can be disabled to give a clean namespace for you to fill using your own predef.- storageBackend
Where will all of Ammonite's persistent data get stored? Things like any
predef.sc
file, compilation/ivy caches, etc.. Defaults include Storage.Folder and Storage.InMemory, though you can create your own.- wd
The working directory of the REPL; when it load scripts, where the scripts will be considered relative to when assigning them packages
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- val defaultPredef: Boolean
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val errorStream: OutputStream
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- val inputStream: InputStream
- def instantiateInterpreter(replApi: Boolean): Interpreter
-
def
instantiateRepl(replArgs: Seq[Bind[_]] = Nil): Repl
Instantiates an ammonite.Repl using the configuration
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val outputStream: OutputStream
- val predef: String
- def run(replArgs: Bind[_]*): Any
-
def
runCode(code: String, replApi: Boolean = false): Unit
Run a snippet of code
-
def
runScript(path: Path, args: Seq[String], kwargs: Seq[(String, String)], replApi: Boolean = false): Res[Imports]
Run a Scala script file! takes the path to the file as well as an array of
args
and a map of keywordkwargs
to pass to that file. - val storageBackend: Storage
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val verboseOutput: Boolean
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- val wd: Path
- val welcomeBanner: Option[String]