Kommons is a set of Kotlin Multiplatform Libraries (MPP) to allow the execution of command lines / scripts, to support print debugging and to ease testing.
MIT License
Bot releases are visible (Hide)
Uri("http://a/b/c/d;p?q").resolve("../g")
// returns
Uri("http://a/b/g")
toMomentString
for negative datesPublished by github-actions[bot] over 1 year ago
Published by github-actions[bot] almost 2 years ago
Upgrade to Kotlin 1.8.0
Kommons Test's dynamic test builders testing
/testingAll
now lazily
build tests as they're consumed by JUnit
Published by github-actions[bot] almost 2 years ago
data class Bar(val bar: Int) {
override fun toString(): String = "bar-$bar"
}
logger.info("Successfully created {}", array(Bar(1), Bar(2)))
{
"@timestamp": "2022-12-14T14:51:57.583+01:00",
"level": "INFO",
"message": "Successfully created bars=[bar-1, bar-2]",
"bars": [
{
"bar": 1
},
{
"bar": 2
}
]
}
Published by github-actions[bot] almost 2 years ago
js.Date
extension functionsPublished by github-actions[bot] almost 2 years ago
Published by github-actions[bot] about 2 years ago
Published by github-actions[bot] about 2 years ago
(つ◕౪◕)つ━☆゚.*・。゚
kommons-exec-deprecated
Published by github-actions[bot] about 2 years ago
pluralize()
extension functionKommons Logging: Core
: get Logback or Kotlin Logger logger easilyKommons Logging: Logback
: configure logging using system properties CONSOLE_LOG_PRESET
and FILE_LOG_PRESET
Kommons Logging: Spring Boot
: configure logging using application properties logging.preset.console
and logging.preset.file
junit.jupiter.execution.parallel.config.dynamic.factor
to 2.Published by github-actions[bot] about 2 years ago
Published by bkahlert about 3 years ago
This is a test release to check if the new workflow works.
Published by bkahlert about 3 years ago
Published by bkahlert about 3 years ago
Published by bkahlert over 3 years ago
public object Wizards : Category() {
public val `(ノ>ω<)ノ﹕・゚’★,。・﹕*﹕・゚’☆`: Kaomoji by parts("(ノ", ">", "ω", "<", ")ノ", " :。・:*:・゚’★,。・:*:・゚’☆")
public val `(# ̄_ ̄)o︠・━・・━・━━・━☆`: Kaomoji by parts(0..1, 2..2, 3..3, 4..4, 5..7, 8..18)
public val `(/ ̄‿ ̄)/~~☆’․・․・﹕★’․・․・﹕☆`: Kaomoji by parts("(/", " ̄", "‿", " ̄", ")/", "~~☆’.・.・:★’.・.・:☆")
public val `(∩ᄑ_ᄑ)⊃━☆゚*・。*・﹕≡( ε﹕)`: Kaomoji by parts("(∩", "ᄑ", "_", "ᄑ", ")⊃", "━☆゚*・。*・:≡( ε:)")
public val `(ノ ˘_˘)ノ ζζζ ζζζ ζζζ`: Kaomoji by parts(0..2, 3..3, 4..4, 5..5, 6..7, 8..21)
public val `(ノ°∀°)ノ⌒・*﹕․。․ ․。․﹕*・゜゚・*☆`: Kaomoji by parts("(ノ", "°", "∀", "°", ")ノ", "⌒・*:.。. .。.:*・゜゚・*☆")
public val `(⊃。•́‿•̀。)⊃━✿✿✿✿✿✿`: Kaomoji by parts(0..2, 3..4, 5..5, 6..7, 8..10, 11..17)
public val `ଘ(੭ˊᵕˋ)੭* ੈ✩‧₊˚`: Kaomoji by parts(0..2, 3..3, 4..4, 5..5, 6..7, 8..14)
}
Published by bkahlert over 3 years ago
CommandLine("printenv", "HOME").exec()
ShellScript { "printenv | grep HOME | perl -pe 's/.*?HOME=//'" }.exec()
ShellScript { … }.exec()
ShellScript { … }.exec.logging()
Process {PID} terminated with exit code {…}
➜ A dump has been written to:
- {WorkDir}/koodies.dump.{}.log
- {WorkDir}/koodies.dump.{}.ansi-removed.log
➜ The last 10 lines are:
{…}
3
2
1
Boom!
ShellScript { … }.exec.processing { io -> doSomething(io) }
io
is typed; simply use io is IO.Output
to filter out errors and meta informationShellScript { … }.exec()
ShellScript { … }.exec.async()
ShellScript { … }.exec()
ShellScript { … }.dockerized{ "bkahlert" / "libguestfs" }.exec()
Whatever variant you choose, life-cycle events, sent input, the process's output and errors are stored for you:
CommandLine(…).exec().io
CommandLine(…).exec().io.output
CommandLine(…).exec().io.error.ansiRemoved
state
, which is either an instance of Running
, Exited
Succeeded
and Failed
) or Excepted
.with(tempDir()) {
SvgFile.copyTo(resolve("koodies.svg"))
// convert SVG to PNG using command line-style docker command
docker("minidocks/librsvg", "-z", 5, "--output", "koodies.png", "koodies.svg")
resolve("koodies.png") asserting { exists() }
// convert PNG to ASCII art using shell script-style docker command
docker("rafib/awesome-cli-binaries", logger = null) {
"""
/opt/bin/chafa -c full -w 9 koodies.png
"""
}.io.output.ansiKept.let { println(it.resetLines()) }
}
&kyTTTTTTTTTTTTTTTTTTTTuvvvvvvvvvvvvvvvvvvvvvvvv\.
RR&kyTTTTTTTTTTTTTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBRR&kyTTTTTTTTTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBBBRR&kyTTTTTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBRR&kyTTTTTvvvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBBRR&kyTx}vvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBBBBRZT}vvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBBBBQxvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBBB&xvvvvvvvvvvvvvvvvvvvvvv\.
BBBBBBZzvvvvvvvvvvvvvvvvvvvvvv\.
BBBBZuvvvvvvvvvvvvvvvvvvvvvv▗▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
BBZTvvvvvvvvvvvvvvvvvvvvvv\.▝▜MMMMMMMMMMMMMMMMMMMM
R3vvvvvvvvvvvvvvvvvvvvvv\. .▝▜MMMMMMMMMMMMMMMMMM
vvvvvvvvvvvvvvvvvvvvvv\. .▝▜MMMMMMMMMMMMMMMM
vvvvvvvvvvvvvvvvvvvv\. .▝▜MMMMMMMMMMMMMM
uxvvvvvvvvvvvvvvvvz3x_ ▝▜MMMMMMMMMMMM
▁3uxvvvvvvvvvvvv▁▅&▆▂gx` ▝▜MMMMMMMMMM
Z▅▁3uxvvvvvvvvz▆WWRZ&▆▂gv. `▀WMMMMMMMM
WR&▄▁3uxvvvvvuk▀BWWWRZ&▆▂gv. .\vvz▀WMMMMMM
WWWRZ▅▁3ux▁▂Zg33k▀BWWWRZ&▆▂g}. .\vvvvvvz▀WMM0W
000WWRZ▅▃▆MM▆▂Zg33k▀BWWWRZ&▆▂g}. .\vvvvvvvvvvx▀BBR
00000WMMMMMMMM▆▂Zg33k▀BWWWRZ&▆▂yxxvvvvvvvvvvvvvx▝▀
0000MMMMMMMMMMMM▆▂Zg33k▀BWWWRZ▆▆▂gTxvvvvvvvvvvvvvx
00MMMMMMMMMMMMMMMM▆▂Zg33k▀BWWWRZ&▆▂gTxvvvvvvvvvvvv
MMMMMMMMMMMMMMMMMMMM▆▂Zg33g▀BWWWRZ&▆▂gTxvvvvvvvvvv
docker
, ubuntu
, busybox
, curl
, download
, …) use the path in the receiver to
start
, run
, stop
, kill
, remove
, search
, image
, ps
engineRunning
, info
, images
, containers
, search
, exec
list
, isPulled
, pull
, tagsOnDockerHub
start
, stop
, state
, kill
, remove
Published by bkahlert almost 4 years ago