Class/Object

ammonite

Main

Related Docs: object Main | package ammonite

Permalink

case class Main(predefCode: String = "", predefFile: Option[Path] = None, defaultPredef: Boolean = true, storageBackend: Storage = ..., wd: Path = os.pwd, welcomeBanner: Option[String] = Some(Defaults.welcomeBanner), inputStream: InputStream = System.in, outputStream: OutputStream = System.out, errorStream: OutputStream = System.err, verboseOutput: Boolean = true, remoteLogging: Boolean = true, colors: Colors = Colors.Default, replCodeWrapper: CodeWrapper = CodeWrapper, scriptCodeWrapper: CodeWrapper = CodeWrapper, alreadyLoadedDependencies: Seq[Dependency] = ...) 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!

predefCode

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

errorStream

Error output when things go bad, typically System.err; also gets sent miscellaneous info messages that aren't strictly part of the REPL or script's output

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Main(predefCode: String = "", predefFile: Option[Path] = None, defaultPredef: Boolean = true, storageBackend: Storage = ..., wd: Path = os.pwd, welcomeBanner: Option[String] = Some(Defaults.welcomeBanner), inputStream: InputStream = System.in, outputStream: OutputStream = System.out, errorStream: OutputStream = System.err, verboseOutput: Boolean = true, remoteLogging: Boolean = true, colors: Colors = Colors.Default, replCodeWrapper: CodeWrapper = CodeWrapper, scriptCodeWrapper: CodeWrapper = CodeWrapper, alreadyLoadedDependencies: Seq[Dependency] = ...)

    Permalink

    predefCode

    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

    errorStream

    Error output when things go bad, typically System.err; also gets sent miscellaneous info messages that aren't strictly part of the REPL or script's output

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. val alreadyLoadedDependencies: Seq[Dependency]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val colors: Colors

    Permalink
  8. val defaultPredef: Boolean

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  10. val errorStream: OutputStream

    Permalink

    Error output when things go bad, typically System.err; also gets sent miscellaneous info messages that aren't strictly part of the REPL or script's output

  11. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. val inputStream: InputStream

    Permalink

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

    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

  14. def instantiateInterpreter(): Either[(Failing, Seq[(Path, Long)]), Interpreter]

    Permalink
  15. def instantiateRepl(replArgs: IndexedSeq[Bind[_]] = Vector.empty): Product with Serializable with Either[(Failure, Seq[(Path, Long)]), Repl]

    Permalink

    Instantiates an ammonite.Repl using the configuration

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def loadedPredefFile: Product with Serializable with Either[(Failure, Seq[(Path, Long)]), Option[PredefInfo]]

    Permalink
  18. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  21. val outputStream: OutputStream

    Permalink

    Primary output of code run using Ammonite

  22. val predefCode: String

    Permalink

    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 predefFile: Option[Path]

    Permalink
  24. val remoteLogging: Boolean

    Permalink
  25. val replCodeWrapper: CodeWrapper

    Permalink
  26. def run(replArgs: Bind[_]*): (Res[Any], Seq[(Path, Long)])

    Permalink

    Run the REPL, with any additional bindings you wish to provide.

    Run the REPL, with any additional bindings you wish to provide.

    Returns an Any representing any value that the user passed into the exit call when closing the REPL (defaults to (): Unit). Also returns a sequence of paths that were watched as a result of this REPL run, in case you wish to re-start the REPL when any of them change.

  27. def runCode(code: String): (Res[Imports], Seq[(Path, Long)])

    Permalink

    Run a snippet of code

  28. def runScript(path: Path, scriptArgs: Seq[(String, Option[String])]): (Res[Any], Seq[(Path, Long)])

    Permalink

    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.

  29. val scriptCodeWrapper: CodeWrapper

    Permalink
  30. val storageBackend: Storage

    Permalink

    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.

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

    Permalink
    Definition Classes
    AnyRef
  32. val verboseOutput: Boolean

    Permalink
  33. final def wait(): Unit

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

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

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

    Permalink

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

  37. val welcomeBanner: Option[String]

    Permalink

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped