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
This commit is contained in:
stomar 2017-03-01 08:54:37 +00:00
Родитель 3cef10489a
Коммит 7957042253
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -711,10 +711,10 @@ module FileUtils
module_function :remove_dir
#
# Returns true if the contents of a file A and a file B are identical.
# Returns true if the contents of a file +a+ and a file +b+ are identical.
#
# FileUtils.compare_file('somefile', 'somefile') #=> true
# FileUtils.compare_file('/bin/cp', '/bin/mv') #=> maybe false
# FileUtils.compare_file('somefile', 'somefile') #=> true
# FileUtils.compare_file('/dev/null', '/dev/urandom') #=> false
#
def compare_file(a, b)
return false unless File.size(a) == File.size(b)