Method: ElFinder::Pathname#rename

Defined in:
lib/el_finder/pathname.rb

#rename(to) ⇒ Object



149
150
151
152
153
154
155
156
# File 'lib/el_finder/pathname.rb', line 149

def rename(to)
  to = self.class.new(@root, to.to_s)
  realpath.rename(to.fullpath.to_s)
rescue Errno::EXDEV
  FileUtils.move(realpath.to_s, to.fullpath.to_s)
ensure
  @path = to.path
end