Issue #7958 has been updated by trans (Thomas Sawyer).


It is not a band-aid. You are not even aware of the code enough to know it is not #extend, but #include. And it's fits precisely to the design of FileUtils. FileUtils is included into FileUtils::Verbose, FileUtils::NoWrite and FileUtils::DryRun, therefore whenever a module is included into FileUtils, FileUtils must also be re-included into those sub-modules b/c of Ruby's well know Inclusion Problem. So it's not working around Ruby at all, but with the very facts of it's design.

I took the time and effort to understand how FileUtils works b/c I have written extensions for FileUtils and have learned the difficulties of doing so because of the old structure of the code. Which is why I took the time and effort to improve the API for the benefit of everyone in the future. You have swept in and summarily issued an edict to revert that work over a single very easily fixable issue, without the first clue of what's really going on with the code as a whole.

It's was clear from the beginning that you had no real interest in what's best for this code, or an appropriate dialog on how to properly address it. Your premature closure of the issue a determent to Ruby. (And for what I suspect to be purely personal and petty reasons, which is exceptionally shameful.) There is no point in a new issue for which I have already provided the solution. You will just ignore it or find another excuse to dismiss it as well, as you have demonstrated by never engaging in an earnest conversation about it to begin with.

----------------------------------------
Bug #7958: include FileUtils::Verbose gives NoMethodError when installing files with a different mode
https://bugs.ruby-lang.org/issues/7958#change-37579

Author: drbrain (Eric Hodel)
Status: Closed
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 2.1.0dev (2013-02-26 trunk 39490) [x86_64-darwin12.2.1]


=begin
Seems like (({fu_stream_blksize})) isn't included when (({FileUtils::Verbose})) is.  Changing to plain FileUtils works, though.

  $ cat test.rb 
  require 'fileutils'
  require 'tmpdir'
  
  include FileUtils::Verbose
  
  Dir.mktmpdir 'test' do |dir|
    install __FILE__, dir, mode: 0600
    install __FILE__, dir, mode: 0640
  end
  
  $ ~/.rubies/trunk/bin/ruby -v test.rb 
  ruby 2.1.0dev (2013-02-26 trunk 39490) [x86_64-darwin12.2.1]
  install -c -m 0600 test.rb /var/folders/87/twjsm89x01161gp5d9qwlx2m0000gn/T/test20130225-53176-197q6me
  install -c -m 0640 test.rb /var/folders/87/twjsm89x01161gp5d9qwlx2m0000gn/T/test20130225-53176-197q6me
  /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:898:in `compare_stream': undefined method `fu_stream_blksize' for main:Object (NoMethodError)
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:882:in `block (2 levels) in compare_file'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:881:in `open'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:881:in `block in compare_file'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:880:in `open'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:880:in `compare_file'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:926:in `block in install'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:1620:in `block in fu_each_src_dest'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:1633:in `fu_each_src_dest0'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:1618:in `fu_each_src_dest'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:925:in `install'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/fileutils.rb:137:in `install'
  	from test.rb:8:in `block in <main>'
  	from /Users/drbrain/.rubies/trunk/lib/ruby/2.1.0/tmpdir.rb:88:in `mktmpdir'
  	from test.rb:6:in `<main>'
=end



-- 
http://bugs.ruby-lang.org/