Package

ammonite

ops

Permalink

package ops

Linear Supertypes
RelPathStuff, Extensions, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ops
  2. RelPathStuff
  3. Extensions
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait BasePath[ThisType <: BasePath[ThisType]] extends AnyRef

    Permalink

    A path which is either an absolute Path or a relative RelPath, with shared APIs and implementations.

  2. trait BasePathImpl[ThisType <: BasePath[ThisType]] extends BasePath[ThisType]

    Permalink
  3. class Bytes extends AnyRef

    Permalink

    Trivial wrapper arround Array[Byte] with sane equality and useful toString

  4. class Callable1[T1, R] extends (T1) ⇒ R

    Permalink

    Provides a.! b as an alternative to the a(b) syntax for calling a function with one argument

  5. class Callable2[T1, T2, R] extends (T1, T2) ⇒ R

    Permalink

    Provides a! b as an alternative to the (a(b, _) syntax for partially applying a function with two arguments

  6. case class Command[T](cmd: Vector[String], envArgs: Map[String, String], execute: (Path, Command[_]) ⇒ T) extends Dynamic with Product with Serializable

    Permalink

    A staged sub-process command that has yet to be executed.

  7. case class CommandResult(exitCode: Int, chunks: Seq[Either[Bytes, Bytes]]) extends Product with Serializable

    Permalink

    Contains the accumulated output for the invocation of a subprocess command.

    Contains the accumulated output for the invocation of a subprocess command.

    Apart from the exit code, the primary data-structure is a sequence of byte chunks, tagged with Left for stdout and Right for stderr. This is interleaved roughly in the order it was emitted by the subprocess, and reflects what a user would have see if the subprocess was run manually.

    Derived from that, is the aggregate out and err StreamValues, wrapping stdout/stderr respectively, and providing convenient access to the aggregate output of each stream, as bytes or strings or lines.

  8. trait Extensions extends AnyRef

    Permalink
  9. sealed trait FileType extends AnyRef

    Permalink

    Simple enum with the possible filesystem objects a path can resolve to

  10. class FilterMapExt[+T, Repr] extends AnyRef

    Permalink

    Extends collections to give short aliases for the commonly used operations, so we can make it easy to use from the command line.

  11. class FilterMapExt2[+T] extends AnyRef

    Permalink

    Extends collections to give short aliases for the commonly used operations, so we can make it easy to use from the command line.

  12. trait ImplicitOp[V] extends (Path) ⇒ V

    Permalink
  13. case class LsSeq(base: Path, listed: RelPath*) extends Seq[Path] with Product with Serializable

    Permalink

    A specialized Seq[Path] used to provide better a better pretty-printed experience

  14. case class Path(segments: Vector[String]) extends BasePathImpl[Path] with Product with Serializable

    Permalink

    An absolute path on the filesystem.

    An absolute path on the filesystem. Note that the path is normalized and cannot contain any empty "", "." or ".." segments

  15. class PermSet extends Set[PosixFilePermission]

    Permalink

    A set of permissions

  16. class Pipeable[T] extends AnyRef

    Permalink

    Lets you pipe values through functions

  17. class RegexContext extends AnyRef

    Permalink

    Lets you pattern match strings with interpolated glob-variables

  18. case class RelPath(segments: Vector[String], ups: Int) extends BasePathImpl[RelPath] with Product with Serializable

    Permalink

    An absolute path on the filesystem.

    An absolute path on the filesystem. Note that the path is normalized and cannot contain any empty or ".". Parent ".." segments can only occur at the left-end of the path, and are collapsed into a single number ups.

  19. implicit class RelPathStart extends AnyRef

    Permalink
    Definition Classes
    RelPathStuff
  20. implicit class RelPathStart2 extends AnyRef

    Permalink
    Definition Classes
    RelPathStuff
  21. trait RelPathStuff extends AnyRef

    Permalink
  22. case class Shellable(s: Seq[String]) extends Product with Serializable

    Permalink

    An implicit wrapper defining the things that can be "interpolated" directly into a subprocess call.

  23. case class ShelloutException(result: CommandResult) extends Exception with Product with Serializable

    Permalink

    Thrown when a shellout command results in a non-zero exit code.

    Thrown when a shellout command results in a non-zero exit code.

    Doesn't contain any additional information apart from the CommandResult that is normally returned, but ensures that failures in subprocesses happen loudly and won't get ignored unless intentionally caught

  24. case class StreamValue(chunks: Seq[Bytes]) extends Product with Serializable

    Permalink

    Encapsulates one of the output streams from a subprocess and provides convenience methods for accessing it in a variety of forms

  25. trait StreamableOp1[T1, R, C <: Seq[R]] extends (T1) ⇒ C

    Permalink

    An Callable1 that returns a Seq[R], but can also do so lazily (Iterator[R]) via op.iter! arg.

    An Callable1 that returns a Seq[R], but can also do so lazily (Iterator[R]) via op.iter! arg. You can then use the iterator however you wish

  26. implicit class Transformable1 extends AnyRef

    Permalink
  27. implicit class iterShow[T] extends AnyRef

    Permalink
    Definition Classes
    Extensions
  28. case class kill(signal: Int) extends (Int) ⇒ CommandResult with Product with Serializable

    Permalink

    Kills the given process with the given signal, e.g.

    Kills the given process with the given signal, e.g. kill(9)! pid

  29. case class stat(name: String, size: Long, mtime: FileTime, owner: UserPrincipal, permissions: PermSet, fileType: FileType) extends Product with Serializable

    Permalink

    The result from doing an system stat on a particular path.

    The result from doing an system stat on a particular path.

    Created via stat! filePath.

    If you want more information, use stat.full

Value Members

  1. val %: Command[Int]

    Permalink

    Used to spawn a subprocess interactively; any output gets printed to the console and any input gets requested from the current console.

    Used to spawn a subprocess interactively; any output gets printed to the console and any input gets requested from the current console. Can be used to run interactive subprocesses like %vim, %python, %ssh "www.google.com" or %sbt.

  2. val %%: Command[CommandResult]

    Permalink

    Spawns a subprocess non-interactively, waiting for it to complete and collecting all output into a CommandResult which exposes it in a convenient form.

    Spawns a subprocess non-interactively, waiting for it to complete and collecting all output into a CommandResult which exposes it in a convenient form. Call via %%('whoami).out.trim or %%('git, 'commit, "-am", "Hello!").exitCode

  3. object /

    Permalink

    Extractor to let you easily pattern match on ops.Paths.

    Extractor to let you easily pattern match on ops.Paths. Lets you do

    @ val base/segment/filename = cwd
    base: Path = Path(Vector("Users", "haoyi", "Dropbox (Personal)"))
    segment: String = "Workspace"
    filename: String = "Ammonite"

    To break apart a path and extract various pieces of it.

  4. object BasePath

    Permalink
  5. implicit def Callable1[T1, R](f: (T1) ⇒ R): Callable1[T1, R]

    Permalink
    Definition Classes
    Extensions
  6. implicit def Callable2[T1, T2, R](f: (T1, T2) ⇒ R): Callable2[T1, T2, R]

    Permalink
    Definition Classes
    Extensions
  7. implicit def ChainableConversions[T, T1, V](f: (T) ⇒ V)(implicit i: (T1) ⇒ T): (T1) ⇒ V

    Permalink
    Definition Classes
    Extensions
  8. object Extensions extends Extensions

    Permalink
  9. object FileType

    Permalink
  10. implicit def FilterMapArrays[T](a: Array[T]): FilterMapExt[T, Array[T]]

    Permalink

    Lets you call FilterMapExt aliases on Arrays too

    Lets you call FilterMapExt aliases on Arrays too

    Definition Classes
    Extensions
  11. implicit def FilterMapExt[T, Repr](i: TraversableLike[T, Repr]): FilterMapExt[T, Repr]

    Permalink
    Definition Classes
    Extensions
  12. implicit def FilterMapIterators[T](a: Iterator[T]): FilterMapExt2[T]

    Permalink
    Definition Classes
    Extensions
  13. object ImplicitWd

    Permalink

    If you want to call subprocesses using % or %% and don't care what working directory they use, import this via

    If you want to call subprocesses using % or %% and don't care what working directory they use, import this via

    import ammonite.ops.ImplicitWd._

    To make them use the process's working directory for each subprocess

  14. object Internals

    Permalink
  15. object Path extends (String) ⇒ Path with Serializable

    Permalink
  16. object PathError

    Permalink
  17. object PermSet

    Permalink
  18. implicit def Pipeable[T](t: T): Pipeable[T]

    Permalink
    Definition Classes
    Extensions
  19. object RegexContext

    Permalink
  20. implicit def RegexContextMaker(s: StringContext): RegexContext

    Permalink
    Definition Classes
    Extensions
  21. object RelPath extends RelPathStuff with (String) ⇒ RelPath with Serializable

    Permalink
  22. implicit def SeqFactoryFunc[T, CC[X] <: Seq[X] with GenericTraversableTemplate[X, CC]](s: SeqFactory[CC]): (Seq[T]) ⇒ CC[T]

    Permalink

    Allows you to pipe sequences into other sequences to convert them, e.g.

    Allows you to pipe sequences into other sequences to convert them, e.g. Seq(1, 2, 3) |> Vector

    Definition Classes
    Extensions
  23. object Shellable extends Serializable

    Permalink
  24. object Shellout

    Permalink

    Iternal utilities to support spawning subprocesses

  25. object cp extends (Path, Path) ⇒ Unit

    Permalink

    Copies a file or folder from one place to another.

    Copies a file or folder from one place to another. Creates any necessary directories, and copies folders recursively.

  26. lazy val cwd: Path

    Permalink

    The current working directory for this process.

  27. val empty: RelPath

    Permalink
    Definition Classes
    RelPathStuff
  28. object exists extends (Path) ⇒ Boolean

    Permalink

    Checks if a file or folder exists at the given path.

  29. implicit def fileData(p: Path): full

    Permalink

    Lets you treat any path as a file, letting you access any property you'd normally access through stat-ing it by stat-ing the file for you when necessary.

  30. val home: Path

    Permalink

    The user's home directory

  31. object ln extends (Path, Path) ⇒ Unit

    Permalink

    Creates a hardlink between two paths.

    Creates a hardlink between two paths. Use .s(src, dest) to create a symlink

  32. object ls extends StreamableOp1[Path, Path, LsSeq] with ImplicitOp[LsSeq]

    Permalink

    List the files and folders in a directory.

    List the files and folders in a directory. Can be called with .iter to return an iterator, or .rec to recursively list everything in subdirectories. .rec is a ls.Walker which means that apart from straight-forwardly listing everything, you can pass in a skip predicate to cause your recursion to skip certain files or folders.

  33. object mkdir extends (Path) ⇒ Unit

    Permalink

    Makes directories up to the specified path.

    Makes directories up to the specified path. Equivalent to mkdir -p in bash

  34. object mv extends (Path, Path) ⇒ Unit with Mover

    Permalink

    Moves a file or folder from one place to another.

    Moves a file or folder from one place to another.

    Creates any necessary directories

  35. implicit val postfixOps: postfixOps

    Permalink
  36. object read extends Reader with (Path) ⇒ String

    Permalink

    Reads a file into memory, either as a String, as (read.lines(...): Seq[String]), or as (read.bytes(...): Array[Byte]).

  37. object rm extends (Path) ⇒ Unit

    Permalink

    Roughly equivalent to bash's rm -rf.

    Roughly equivalent to bash's rm -rf. Deletes any files or folders in the target path, or does nothing if there aren't any

  38. val root: Path

    Permalink

    The root of the filesystem

  39. object stat extends (Path) ⇒ stat with Serializable

    Permalink
  40. val up: RelPath

    Permalink
    Definition Classes
    RelPathStuff
  41. object write extends (Path, Writable) ⇒ Unit

    Permalink

    Write some data to a file.

    Write some data to a file. This can be a String, an Array[Byte], or a Seq[String] which is treated as consecutive lines. By default, this fails if a file already exists at the target location. Use write.over or write.append if you want to over-write it or add to what's already there.

Inherited from RelPathStuff

Inherited from Extensions

Inherited from AnyRef

Inherited from Any

Ungrouped