ruby/ruby — pull request #60 by aef (2011-11-17 21:50:58+00:00)
Title: Pathname['abc'] instead of Pathname('abc') global method as constructor alternative

I made it possible to use Pathname.[] as an alternative to Pathname.new, as the Set class does it already. Also I did mark the global Pathname() method deprecated because I think poisoning the global namespace with methods named after classes should be considered bad style. I hope you share that opinion.

I've also written a patch for rubyspec which tests the new methods and runs at least in MRI 1.9.2 and 1.9.3. It does although not test for the deprecation warnings, because Brian Ford wouldn't accept the patch if it would do so. It is available here: https://github.com/aef/rubyspec/tree/pathname_brackets_instead_global_method