Ruby Forum Ruby-core > [Ruby 1.9 - Feature #427] (Open) FileTest return values

Posted by Anonymous (Guest)
on 12.08.2008 13:26
(Received via mailing list)
Issue #427 has been reported by Anonymous.

----------------------------------------
Feature #427: FileTest return values
http://redmine.ruby-lang.org/issues/show/427

Author: Anonymous
Status: Open
Priority: Normal
Assigned to:
Category: core
Target version:


It would be more convenient if FileTest.directory? and FileTest.file? 
and perhaps some other FileTest methods returned the receiver if true, 
rather than just true value. That would allow the test to be used with 
assignments. E.g.

  dir = FileTest.directory?('/home')

instead of

  dir = '/home' if FileTest.directory?('/home')

The change is backward compatible. However, it would effect Pathname, 
which may need to be adjusted to take this into account properly.
Posted by Yukihiro Matsumoto (Guest)
on 23.09.2008 04:29
(Received via mailing list)
Issue #427 has been updated by Yukihiro Matsumoto.

Status changed from Open to Rejected

this is short, but unintuitive, I think.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/427