Created
December 14, 2016 22:27
-
-
Save trane/a355f17907575bfd7bd25141e553aca8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Prepare { | |
val id: PrepareId | |
} | |
case class Preparing(id: PrepareId) extends Prepare | |
case class Prepared(id: PrepareId, paths: Seq[Path]) extends Prepare | |
object Prepare { | |
def pathStrings(prepare: Prepare): Seq[String] = prepare match { | |
case Preparing(_) => Seq.empty[String] | |
case Prepared(_, paths) => paths.map(_.toAbsolutePath.toString) | |
} | |
implicit class PrepareOps(val prepare: Prepare) { | |
def pathStrings: Seq[String] = Prepare.pathStrings(prepare) | |
} | |
} | |
repositoryService.prepared(id).pathString |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment