The problem is not sharing. Get rid of the Arrayrefinement completely and you will get the same behavior.
According to the documentation :
eval, . . , . , , , .
, , refine do ⇒ include. include refine. , , "" .
, refinemenets, ruby ( ):
$ref = lambda do
def foo
puts :in_foo
end
public :foo
def bar
puts :in_bar
foo
end
public :bar
end
module Ext
refine ::Hash do
$ref.call
end
end
module Test
using Ext
::Hash.new.bar
end