Feature #427

FileTest return values

Added by Anonymous over 7 years ago. Updated over 4 years ago.

Assignee:Yukihiro Matsumoto


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.


#1 Updated by Koichi Sasada about 7 years ago

  • Assignee set to Yukihiro Matsumoto



#2 Updated by Yukihiro Matsumoto about 7 years ago

  • Status changed from Open to Rejected

this is short, but unintuitive, I think.

Also available in: Atom PDF