ProcessImplicits

scala.sys.process.ProcessImplicits

Provides implicit conversions for the factories offered by scala.sys.process.Process's companion object. These implicits can then be used to decrease the noise in a pipeline of commands, making it look more shell-like. They are available through the package object scala.sys.process.

Attributes

Source
Process.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Implicits

Implicits

implicit def builderToProcess(builder: JProcessBuilder): ProcessBuilder

Implicitly convert a java.lang.ProcessBuilder into a Scala one.

Implicitly convert a java.lang.ProcessBuilder into a Scala one.

Value parameters

builder

the java.lang.ProcessBuilder to convert

Attributes

Returns

a Scala ProcessBuilder wrapping the given Java process builder

Source
Process.scala
implicit def buildersToProcess[T](builders: Seq[T])(implicit convert: T => Source): Seq[Source]

Returns a sequence of scala.sys.process.ProcessBuilder.Source from a sequence of values for which an implicit conversion to Source is available.

Returns a sequence of scala.sys.process.ProcessBuilder.Source from a sequence of values for which an implicit conversion to Source is available.

Type parameters

T

the type of the elements to be converted to Source

Value parameters

builders

the sequence of elements to convert

convert

the implicit conversion from T to Source

Attributes

Returns

a sequence of Source instances converted from the input elements

Source
Process.scala
implicit def fileToProcess(file: File): FileBuilder

Implicitly convert a java.io.File into a scala.sys.process.ProcessBuilder.FileBuilder, which can be used as either input or output of a process. For example:

Implicitly convert a java.io.File into a scala.sys.process.ProcessBuilder.FileBuilder, which can be used as either input or output of a process. For example:

import scala.sys.process._
"ls" #> new java.io.File("dirContents.txt") !

Value parameters

file

the file to convert into a FileBuilder

Attributes

Returns

a FileBuilder wrapping the given file

Source
Process.scala
implicit def stringSeqToProcess(command: Seq[String]): ProcessBuilder

Implicitly convert a sequence of String into a scala.sys.process.ProcessBuilder. The first argument will be taken to be the command to be executed, and the remaining will be its arguments. When using this, arguments may contain spaces.

Implicitly convert a sequence of String into a scala.sys.process.ProcessBuilder. The first argument will be taken to be the command to be executed, and the remaining will be its arguments. When using this, arguments may contain spaces.

Value parameters

command

a sequence where the first element is the executable and the rest are arguments

Attributes

Returns

a ProcessBuilder for the given command sequence

Source
Process.scala
implicit def stringToProcess(command: String): ProcessBuilder

Implicitly convert a String into a scala.sys.process.ProcessBuilder.

Implicitly convert a String into a scala.sys.process.ProcessBuilder.

Value parameters

command

the command string to convert into a ProcessBuilder

Attributes

Returns

a ProcessBuilder for the given command string

Source
Process.scala
implicit def urlToProcess(url: URL): URLBuilder

Implicitly convert a java.net.URL into a scala.sys.process.ProcessBuilder.URLBuilder , which can be used as input to a process. For example:

Implicitly convert a java.net.URL into a scala.sys.process.ProcessBuilder.URLBuilder , which can be used as input to a process. For example:

import scala.sys.process._
Seq("xmllint", "--html", "-") #< new java.net.URL("https://www.scala-lang.org") #> new java.io.File("fixed.html") !

Value parameters

url

the URL to convert into a URLBuilder

Attributes

Returns

a URLBuilder wrapping the given URL

Source
Process.scala