Skip to content

Commit

Permalink
Merge pull request #1 from rbbl-dev/dev
Browse files Browse the repository at this point in the history
added utility function to easily provide a path
  • Loading branch information
pcimcioch committed Nov 16, 2022
2 parents 1394deb + 2f85047 commit fcfdc91
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/kotlin/pcimcioch/gitlabci/dsl/GitlabCiDsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ fun gitlabCi(validate: Boolean = true, writer: Writer? = null, block: GitlabCiDs
}
}

fun gitlabCi(validate: Boolean = true, path: String, block: GitlabCiDsl.() -> Unit) {
FileWriter(path).use {
gitlabCi(validate, it, block)
}
}

internal fun <T : DslBase> serializeToYaml(strategy: SerializationStrategy<T>, value: T, writer: Writer) {
val config = YamlConfiguration(encodeDefaults = false)
val yaml = Yaml(configuration = config)
Expand Down

0 comments on commit fcfdc91

Please sign in to comment.