ammonite

Main

case class Main(predef: String = "", defaultPredef: Boolean = true, storageBackend: Storage = ..., wd: Path = ammonite.ops.`package`.pwd, welcomeBanner: Option[String] = ..., inputStream: InputStream = java.this.lang.System.in, outputStream: OutputStream = java.this.lang.System.out, infoStream: OutputStream = java.this.lang.System.err, errorStream: OutputStream = java.this.lang.System.err, verboseOutput: Boolean = true, remoteLogging: 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.repl.Repl object itself, and has a similar set of parameters, but does not have any of the ammonite.repl.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

inputStream

Where input to the Repl is coming from, typically System.in, but it could come from somewhere else e.g. across the network in the case of the SshdRepl

outputStream

Primary output of code run using Ammonite

infoStream

Miscellaneous logging output when running Ammonite. This is typically stuff you want to see when running interactively, but not something you want to see when e.g. you forward a script's output to a file. This by default it goes to System.err

errorStream

Error output when things go bad, typically System.err

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Main
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Main(predef: String = "", defaultPredef: Boolean = true, storageBackend: Storage = ..., wd: Path = ammonite.ops.`package`.pwd, welcomeBanner: Option[String] = ..., inputStream: InputStream = java.this.lang.System.in, outputStream: OutputStream = java.this.lang.System.out, infoStream: OutputStream = java.this.lang.System.err, errorStream: OutputStream = java.this.lang.System.err, verboseOutput: Boolean = true, remoteLogging: 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

    inputStream

    Where input to the Repl is coming from, typically System.in, but it could come from somewhere else e.g. across the network in the case of the SshdRepl

    outputStream

    Primary output of code run using Ammonite

    infoStream

    Miscellaneous logging output when running Ammonite. This is typically stuff you want to see when running interactively, but not something you want to see when e.g. you forward a script's output to a file. This by default it goes to System.err

    errorStream

    Error output when things go bad, typically System.err

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val defaultPredef: Boolean

    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.

    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.

  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. val errorStream: OutputStream

    Error output when things go bad, typically System.

    Error output when things go bad, typically System.err

  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. val infoStream: OutputStream

    Miscellaneous logging output when running Ammonite.

    Miscellaneous logging output when running Ammonite. This is typically stuff you want to see when running interactively, but not something you want to see when e.g. you forward a script's output to a file. This by default it goes to System.err

  14. val inputStream: InputStream

    Where input to the Repl is coming from, typically System.

    Where input to the Repl is coming from, typically System.in, but it could come from somewhere else e.g. across the network in the case of the SshdRepl

  15. def instantiateInterpreter(replApi: Boolean): Interpreter

  16. def instantiateRepl(replArgs: Seq[Bind[_]] = Nil, remoteLogger: Option[RemoteLogger]): Repl

    Instantiates an ammonite.

    Instantiates an ammonite.Repl using the configuration

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. val outputStream: OutputStream

    Primary output of code run using Ammonite

  22. val predef: String

    Any additional code you want to run before the REPL session starts.

    Any additional code you want to run before the REPL session starts. Can contain multiple blocks separated by @s

  23. val remoteLogging: Boolean

  24. def run(replArgs: Bind[_]*): Any

  25. def runCode(code: String, replApi: Boolean = false): Unit

    Run a snippet of code

  26. def runScript(path: Path, scriptArgs: Seq[(String, Option[String])], replApi: Boolean = false): Res[Any]

    Run a Scala script file! takes the path to the file as well as an array of args and a map of keyword kwargs to pass to that file.

  27. val storageBackend: Storage

    Where will all of Ammonite's persistent data get stored? Things like any predef.sc file, compilation/ivy caches, etc.

    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.

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. val verboseOutput: Boolean

  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. val wd: Path

    The working directory of the REPL; when it load scripts, where the scripts will be considered relative to when assigning them packages

  34. val welcomeBanner: Option[String]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped