Issue #4085 has been updated by Dave Thomas.


  module Quux
    using FooExt

    foo = Foo.new
    foo.bar  # => FooExt#bar
    foo.baz  # => Foo#bar
  end

This behavior makes me nervous???I can see arguments for it, but at the same time I can see in leading to problems, particularly in well structured classes where a large set of behaviors is defined in terms of one method. I'm sure the syntax below is wrong, but look at the spirit of it.

  module DoubleEach
    refine Array do
      def each
         super do |val|
           yield 2*val
         end
      end
    end
  end

  using DoubleEach

  [ 1, 2, 3 ].each {|v| p v }   #=> 2, 4, 6

  [ 1, 2, 3 ].min    #=> 1

That would be surprising to me, as I'd expect the behavior of all the Enumerable methods, which depend on each, to change if I change the behavior of each.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/4085

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