I appreciate the Ruby love in this post, but it's worth pointing out that the author is clearly new to the language. I say that because he writes Ruby as if he's writing some other language, and not idiomatic Ruby. This: dirp = Dir.open(".") for f in dirp case f when /\.rb\z/ print f, "\n" else # do not print end end dirp.close Could be made much more Ruby-native (and simpler!) as: Dir.open('.').each do |f| puts f if…
So the weirdest part is that the OP is literally just a cut and paste of a bunch of scripts found in the ruby distribution "samples" folder (that I had no idea even existed). That pretty not great ruby wasn't written by the author -- it's actually included in a "sample" file with the ruby distro? https://github.com/ruby/ruby/blob/ruby_3_1/sample/dir.rb A file whose commit history shows... it's part of the very first…
In any case, I wonder if the OP's motives were good or if this was just some SEO game... we have enough of the latter on the internet.