Quicker WEBrick startup
Despite its popularity WEBrick has gained some notoriety since the code is completely undocumented.
WEBrick is the little web server in the Ruby standard library, and I’ve used it
several times when I’ve needed to embed a little server in a project. I noticed
a couple of problems in my latest little program: it took a few seconds to start
up, and always included a TCPServer Error: Address already in use - bind(2)
warning in its startup messages.
After watching this happen a few dozen times, I found solutions to both these annoyances, and they’re here in the hope that someone else will Google their way here: just create your server object like this: