Don't use str as key, use array.

Think about this case:
name:file11
size:22
mod_time:33

name: file
size:112
mod_time:233

You can use the following as key (don't even change to string! numbers take less memory)
key = [File.basename(path), size, mod_time]