Method: Zip::ZipFile#rename

Defined in:
lib/zip/zip.rb

#rename(entry, newName, &continueOnExistsProc) ⇒ Object

Renames the specified entry.



1458
1459
1460
1461
1462
1463
# File 'lib/zip/zip.rb', line 1458

def rename(entry, newName, &continueOnExistsProc)
  foundEntry = get_entry(entry)
  check_entry_exists(newName, continueOnExistsProc, "rename")
  get_output_stream(newName) { |os| os.write(read(foundEntry)) }                  
  remove(foundEntry)
end