A translation of Python's fnmatch function into Ruby