ruby script file path code example Example: ruby filename from path Click to copypath = "/path/to/file.ext" File.basename(path) # 'file.ext'