Could you add `::File.exist?(::File.expand_path(val))` to make it working also with relative paths?