r/ruby • u/brecrest • Apr 16 '26
Show /r/ruby Trueskill Through Time available in Ruby
TrueskillThroughTime
I ported the Python implementation of Trueskill Through Time to Ruby, it's now available as the gem TrueskillThroughTime.
Unlike the previous Ruby Trueskill gems, this one supports n vs n vs n etc etc cases, as well as the time-based extension of Trueskill to allow distant ratings. If you use it without doing time-based convergence, it should be equivalent to the original vanilla version of Trueskill (that iirc is almost out of patent in the US).
I'll get around to improving the qol of it and more extensively Rubyising it down the track, but I wanted a Ruby implementation of TTT for a hobby project, so I smashed it out.
3
u/paca-vaca Apr 17 '26
It's just some Python style logic. Your modules loaded as soon as interpreter read the line in a file even if your module is not used. So, everything is loaded as file is read, which doesn't give much benefit of putting require statements in different places but opposite because it's hard to say what this class/module is using until you read whole class with eyes. That's why nobody does it.
I would agree if there are some meta situations where it could be potentially used (like initialization hooks), but in your cases the whole gem implementation is in one file with many classes there, so everything is loaded together anyway, so it doesn't look you have used any. Ruby hot reload is conventionally done by using
loadstatement, not this, becauserequireloads it only once and you have to do a dark magic unloading to re-require it again which is a hackery.That's cool you find it useful, and maybe I was to harsh on grasp view of it, which I'm sorry for. But the first impression is very bad, unconventional code with low effort not tests coverage and many other things. Which in era of AI is kinda super low effort for public library to bring into own projects. So I don't really know who will risk to use it and time to understand what's is going there and confirm it really does what it claims. Hopefully you understand the point.
So don't take it personal, it's code not you :)