Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ratch/support/filename.rb

Instance Method Summary collapse

Instance Method Details

#to_actual_filenameObject

Find actual filename (casefolding) and returns it. Returns nil if no file is found.



6
7
8
# File 'lib/ratch/support/filename.rb', line 6

def to_actual_filename
  Dir.glob(self, File::FNM_CASEFOLD).first
end

#to_actual_filename!Object

Find actual filename (casefolding) and replace string with it. If file not found, string remains the same and method returns nil.



13
14
15
16
# File 'lib/ratch/support/filename.rb', line 13

def to_actual_filename!
  filename = to_actual_filename
  replace(filename) if filename
end