Method: Rush::Entry#duplicate

Defined in:
lib/rush/entry.rb

#duplicate(new_name) ⇒ Object

Rename an entry to another name within the same dir. The existing object will not be affected, but a new object representing the newly-created entry will be returned.



97
98
99
100
101
102
# File 'lib/rush/entry.rb', line 97

def duplicate(new_name)
  raise Rush::NameCannotContainSlash if new_name.match(/\//)
  new_full_path = "#{@path}/#{new_name}"
  connection.copy(full_path, new_full_path)
  self.class.new(new_full_path, box)
end