Module: Utilities

Defined in:
lib/sambal-cle/utilities.rb

Instance Method Summary collapse

Instance Method Details

#get_filename(path_plus_name_string) ⇒ Object

Strips the file name away from the path information.

This way it’s not necessary to define variables for BOTH the file name and the file path + file name. Just define the path + name and then use this method to extract only the filename portion.

NOTE: This may be deprecated in the future, so think hard before using it.



14
15
16
17
# File 'lib/sambal-cle/utilities.rb', line 14

def get_filename(path_plus_name_string)
  path_plus_name_string =~ /(?<=\/).+/
  return $~.to_s
end