Using a global method is consistent with Array, Float, Integer, etc though. Konstantin On Nov 17, 2011, at 23:16 , Alexander E. Fischer wrote: > Hello, > > I think it would be a good idea to allow Pathname objects to be created > in the same alternative way Set objects can be created: > > Pathname['abc'] > > In current Ruby implementations a slightly different approach is used: > > Pathname('abc') > > The current approach requires to register a global method which I > consider bad style. Therefore I would like to get rid of the current > method and implement the proposed one. > > I wrote a patch that does exactly that. Also I did mark the global > Pathname() method deprecated by sending a warning on usage. > > My pull request can be found here: https://github.com/ruby/ruby/pull/61 > > I've also written a patch for rubyspec which tests the new method 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