ruby-changes:45676
From: stomar <ko1@a...>
Date: Wed, 1 Mar 2017 17:54:43 +0900 (JST)
Subject: [ruby-changes:45676] stomar:r57749 (trunk): fileutils.rb: improve docs for FileUtils.compare_file
stomar 2017-03-01 17:54:37 +0900 (Wed, 01 Mar 2017) New Revision: 57749 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57749 Log: 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. Modified files: trunk/lib/fileutils.rb Index: lib/fileutils.rb =================================================================== --- lib/fileutils.rb (revision 57748) +++ lib/fileutils.rb (revision 57749) @@ -711,10 +711,10 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L711 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/