Project

General

Profile

Misc #12365

[DOC] Suggestion to change FileUtils.compare_file

Added by shevegen (Robert A. Heiler) about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:75431]

Description

Hello.

The documentation at:

http://ruby-doc.org/stdlib-2.3.1/libdoc/fileutils/rdoc/FileUtils.html#method-c-compare_file

shows the "return" value in the second example to be:

#=> maybe false

I am not sure what this means, so my suggestion would be to instead, get
rid of the "maybe" part there and stick just to "false". And to instead
document above the method definition, under which circumstance can the
second check return false, e. g. via examples or just by explanation.

I found a return value of "maybe false" confusing.

Associated revisions

Revision 79570422
Added by stomar (Marcus Stollsteimer) over 2 years ago

fileutils.rb: improve docs for FileUtils.compare_file

  • lib/fileutils.rb (compare_file): [DOC] clarify documentation by avoiding confusing return value of "maybe false".

[ruby-core:75431] [Misc #12365] reported by Robert A. Heiler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57749
Added by stomar (Marcus Stollsteimer) over 2 years ago

fileutils.rb: improve docs for FileUtils.compare_file

  • lib/fileutils.rb (compare_file): [DOC] clarify documentation by avoiding confusing return value of "maybe false".

[ruby-core:75431] [Misc #12365] reported by Robert A. Heiler.

Revision 57749
Added by stomar (Marcus Stollsteimer) over 2 years ago

fileutils.rb: improve docs for FileUtils.compare_file

  • lib/fileutils.rb (compare_file): [DOC] clarify documentation by avoiding confusing return value of "maybe false".

[ruby-core:75431] [Misc #12365] reported by Robert A. Heiler.

Revision 57749
Added by stomar (Marcus Stollsteimer) over 2 years ago

fileutils.rb: improve docs for FileUtils.compare_file

  • lib/fileutils.rb (compare_file): [DOC] clarify documentation by avoiding confusing return value of "maybe false".

[ruby-core:75431] [Misc #12365] reported by Robert A. Heiler.

History

Updated by naruse (Yui NARUSE) about 3 years ago

I think the author considered BusyBox.

Therefore it is not a good example.
I think /dev/null and /dev/random is better...

Updated by stomar (Marcus Stollsteimer) over 2 years ago

I used /dev/urandom in the example because /dev/random might block.

Updated by stomar (Marcus Stollsteimer) over 2 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF