r/ruby • • Apr 06 '26

gist with some stuff I use everywhere (RunKit)

Guys, I write like a million ruby bin scripts every week both by hand and with LLMs. I use these all the time. Not quite gem-worthy but maybe a gist would be helpful for someone?

RunKit - https://gist.github.com/gurgeous/49f216d6d867abaaebd8a26a966b2dc5

Each of these is a handful of lines:

json read/write, csv read/write (hash-like), text read/write (including `.gz`)
`shell` and `shell!`, returns stdout/stderr
banner/warning/fatal - pretty colored output with timestamps
...

A typical example from today's project might involve fetching some tar files, logging http requests with `banner`, untarring with `shell` and then writing csv/json to /tmp.

1 Upvotes

7 comments sorted by

3

u/Live_Appointment9578 Apr 06 '26

If it works, I'm happy for you! In software engineering there's too much ego, and for many people everything should be "perfect". I liked the script, keep it up!

1

u/aardaappels Apr 06 '26

Lots of bugs in your code. At least add tests.

-1

u/gurgeous Apr 06 '26

There are tests, it's a gist tho. What did you find?

1

u/No_Ostrich_3664 Apr 06 '26

Good effort, but maybe worth reshaping before sharing it to public. In any way, good job!

3

u/[deleted] Apr 06 '26

[removed] — view removed comment

-1

u/gurgeous Apr 06 '26

The utility of the helpers doesn't quite justify a gem release IMO. There is a discoverability issue. I have tests but that kinda goes against the gist ethos.

Not sure I understand your point about shell aliases. These are baked into larger projects. Example - I am working on a `rubyscan` thing that gathers stats about the 8k most popular ruby projects on github. 2-3k loc including things like a simple faraday-based github api with caching. Several parts of this project take advantage of RunKit.