This is at least the third time I've seen this gsub pattern so far. #fix_windows_path_slashes helper method? I'll mention #platform_specific_path here again. It may suit your needs or give you ideas on better ways to do that.