Why is the pathname chdir method deprecated?

Why is the pathname chdir method deprecated since ruby ​​1.8.1? What is wrong with him?

It:

 dir = Pathname('a') dir.chdir do ... end 

shorter and more readable than this:

 dir = Pathname('a') Dir.chdir(dir) do ... end 
+4
source share
2 answers

There is nothing wrong with that; Pathname simply not suitable for this.

Use Dir.chdir instead.

Source: http://corelib.rubyonrails.org/classes/Pathname.html#M000633 (click "[Source]")

+1
source

All Articles