-
Clone the respository.
-
Run
./gradlew installDist
. This will install a distribution to the folderbuild/install/transpose-gherkin-datatable
in the repository. -
Pass a Gherkin data table through the STDIN to the script
build/install/transpose-gherkin-datatable/bin/transpose-gherkin-datatable
to get the transposed data table on the STDOUT. -
As the full path to the script is rather cumbersome to write all the time, I suggest you create a symbolic link to the script somewhere on your PATH.
Given you copied a Gherkin data table to the clipboard. Then you can transpose that data table with the following command:
pbpaste | <repo-home>/build/install/transpose-gherkin-datatable/bin/transpose-gherkin-datatable
I recently needed to transpose a Gherkin data table, but ChatGPT wasn’t available and I couldn’t find a Transpose Data Table function in my Cucumber plugin in my IDE.
Later that day, I felt the urge to finally write something in Kotlin again. I remembered my need to transpose a Gherkin data table earlier in the day and started typing.
I hacked something together. Pretty quick 'n' dirty. I didn’t need it to be bulletproof. It just had to do the job and give me a chance to have a little Kotlin refresher. The result is certainly not great, completely untested and probably far from idiomatic Kotlin. But it was entertaining. I had fun.
Then I remembered this gem of a library for writing CLIs in Kotlin: Clikt. So I added it. If you don’t know it yet, have a look at it.
Then I found out that the author of Clikt has also written Mordant. It’s a library that provides styling and widgets for command line applications. So I added that too.
Then I thought now might be a good time to google again for a semantic release gradle plugin. Guess what, there is one: Nyx. Great, now I’m back to using conventional commits to automatically bump the semantic version of my project.
I hear an owl hooting. I look out of the window. It was getting dark. Let’s go to bed…
Who knows what else I might add to this silly little project. A project that is completely unnecessary as ChatGPT is back and another Cucumber plugin for my IDE certainly provides the transpose data table feature I needed. But I’ll remain ignorant of all this. This silly project has proved to be too good a playground. I’ll keep on playing…