Ruby implementation of discoteq