Why is the pathname chdir method deprecated since ruby ββ1.8.1? What is wrong with him?
chdir
It:
dir = Pathname('a') dir.chdir do ... end
shorter and more readable than this:
dir = Pathname('a') Dir.chdir(dir) do ... end
There is nothing wrong with that; Pathname simply not suitable for this.
Pathname
Use Dir.chdir instead.
Dir.chdir
Source: http://corelib.rubyonrails.org/classes/Pathname.html#M000633 (click "[Source]")
There is also FileUtils.cd('/', :verbose => true)
FileUtils.cd('/', :verbose => true)