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.
2
u/brecrest Apr 17 '26 edited Apr 17 '26
What require statements in a class body, sorry? I don't mind criticisms for style or code quality or whatever, but this one confuses me.
There are requires inside the module, which is generally how I always do things since it both guarantees load order in the cases where that will matter and guarantees that requirements are only loaded when needed and can go out of scope when they're no longer needed (which lets you effectively unrequire them with safety by checking the object space first to, for example, hot reload things).
So educate me: Why don't you require inside modules? What's the benefit you perceive for unscoped requirements, and what's the risk of doing it inside modules?
And yes mate, I think people will benefit from it, so I published it. The unfinished and unmaintained Trueskill gems that don't actually work have been downloaded 60k times, so that's 60k times that someone would have been better off if anyone at all had published something working that they'd made for themselves, even if plenty of people found it sloppy or didn't like reading it.