Sha256: 50f48f1a2582af47ee0e07fb442dd7fd346bcb2d9c628d00f09a1fd52af2f959
Contents?: true
Size: 429 Bytes
Versions: 5
Compression:
Stored size: 429 Bytes
Contents
class String # Find actual filename (casefolding) and returns it. # Returns nil if no file is found. def to_actual_filename Dir.glob(self, File::FNM_CASEFOLD).first end # Find actual filename (casefolding) and replace string with it. # If file not found, string remains the same and method returns nil. def to_actual_filename! filename = to_actual_filename replace(filename) if filename end end
Version data entries
5 entries across 5 versions & 2 rubygems