Skip to content

Commit

Permalink
Change verbs, add more methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zarthross committed Aug 12, 2024
1 parent 0cdae5c commit 41f4504
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ sealed abstract class WorkflowJob {
def withTimeoutMinutes(timeoutMinutes: Option[Int]): WorkflowJob

def updatedEnv(name: String, value: String): WorkflowJob
def appendSteps(steps: List[WorkflowStep]): WorkflowJob
def concatEnv(envs: TraversableOnce[(String, String)]): WorkflowJob
def appendedStep(step: WorkflowStep): WorkflowJob
def concatStep(suffixSteps: TraversableOnce[WorkflowStep]): WorkflowJob
}

object WorkflowJob {
Expand Down Expand Up @@ -153,8 +155,10 @@ object WorkflowJob {
override def withConcurrency(concurrency: Option[Concurrency]): WorkflowJob = copy(concurrency = concurrency)
override def withTimeoutMinutes(timeoutMinutes: Option[Int]): WorkflowJob = copy(timeoutMinutes = timeoutMinutes)

def updatedEnv(name: String, value: String): WorkflowJob = withEnv(env.updated(name, value))
def appendSteps(steps: List[WorkflowStep]): WorkflowJob = withSteps(this.steps ++ steps)
def updatedEnv(name: String, value: String): WorkflowJob = copy(env = env.updated(name, value))
def concatEnv(envs: TraversableOnce[(String, String)]): WorkflowJob = copy(env = this.env ++ envs)
def appendedStep(step: WorkflowStep): WorkflowJob = copy(steps = this.steps :+ step)
def concatStep(suffixSteps: TraversableOnce[WorkflowStep]): WorkflowJob = copy(steps = this.steps ++ suffixSteps)
// scalafmt: { maxColumn = 96 }

override def productPrefix = "WorkflowJob"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sealed abstract class WorkflowStep extends Product with Serializable {
def withTimeoutMinutes(minutes: Option[Int]): WorkflowStep

def updatedEnv(name: String, value: String): WorkflowStep
def addEnv(env: Map[String, String]): WorkflowStep
def concatEnv(env: TraversableOnce[(String, String)]): WorkflowStep
}

object WorkflowStep {
Expand Down Expand Up @@ -127,9 +127,9 @@ object WorkflowStep {
def withWorkingDirectory(workingDirectory: Option[String]): Run

def updatedEnv(name: String, value: String): Run
def addEnv(env: Map[String, String]): Run
def concatEnv(env: TraversableOnce[(String, String)]): Run
def updatedParams(name: String, value: String): Run
def addParams(params: Map[String, String]): Run
def concatParams(params: TraversableOnce[(String, String)]): Run
}

object Run {
Expand Down Expand Up @@ -167,9 +167,9 @@ object WorkflowStep {
def withWorkingDirectory(workingDirectory: Option[String]) = copy(workingDirectory = workingDirectory)

def updatedEnv(name: String, value: String) = copy(env = this.env.updated(name, value))
def addEnv(env: Map[String, String]) = copy(env = this.env ++ env)
def concatEnv(env: TraversableOnce[(String, String)]) = copy(env = this.env ++ env)
def updatedParams(name: String, value: String) = copy(params = this.params.updated(name, value))
def addParams(params: Map[String, String]) = copy(params = this.params ++ params)
def concatParams(params: TraversableOnce[(String, String)]) = copy(params = this.params ++ params)
// scalafmt: { maxColumn = 96 }
}
}
Expand All @@ -184,9 +184,9 @@ object WorkflowStep {
def withPreamble(preamble: Boolean): Sbt

def updatedEnv(name: String, value: String): Sbt
def addEnv(env: Map[String, String]): Sbt
def concatEnv(env: TraversableOnce[(String, String)]): Sbt
def updatedParams(name: String, value: String): Sbt
def addParams(params: Map[String, String]): Sbt
def concatParams(params: TraversableOnce[(String, String)]): Sbt
}

object Sbt {
Expand Down Expand Up @@ -224,9 +224,9 @@ object WorkflowStep {
def withPreamble(preamble: Boolean) = copy(preamble = preamble)

def updatedEnv(name: String, value: String) = copy(env = this.env.updated(name, value))
def addEnv(env: Map[String, String]) = copy(env = this.env ++ env)
def concatEnv(env: TraversableOnce[(String, String)]) = copy(env = this.env ++ env)
def updatedParams(name: String, value: String) = copy(params = params.updated(name, value))
def addParams(params: Map[String, String]) = copy(params = this.params ++ params)
def concatParams(params: TraversableOnce[(String, String)]) = copy(params = this.params ++ params)
// scalafmt: { maxColumn = 96 }
}
}
Expand All @@ -239,9 +239,9 @@ object WorkflowStep {
def withParams(params: Map[String, String]): Use

def updatedEnv(name: String, value: String): Use
def addEnv(env: Map[String, String]): Use
def concatEnv(env: TraversableOnce[(String, String)]): Use
def updatedParams(name: String, value: String): Use
def addParams(params: Map[String, String]): Use
def concatParams(params: TraversableOnce[(String, String)]): Use
}

object Use {
Expand Down Expand Up @@ -277,9 +277,9 @@ object WorkflowStep {
def withParams(params: Map[String, String]) = copy(params = params)

def updatedEnv(name: String, value: String) = copy(env = this.env.updated(name, value))
def addEnv(env: Map[String, String]) = copy(env = this.env ++ env)
def concatEnv(env: TraversableOnce[(String, String)]) = copy(env = this.env ++ env)
def updatedParams(name: String, value: String) = copy(params = params.updated(name, value))
def addParams(params: Map[String, String]) = copy(params = this.params ++ params)
def concatParams(params: TraversableOnce[(String, String)]) = copy(params = this.params ++ params)
// scalafmt: { maxColumn = 96 }
}
}
Expand Down

0 comments on commit 41f4504

Please sign in to comment.