require 'facet/module/rename' require 'facet/module/redef' require 'facet/module/remove' require 'facet/module/undef' require 'facet/module/wrap' #require 'facet/module/revisal' class Module def integrate( mod, &blk ) #include mod.revisal( &blk ) m = Module.new { include mod } m.class_eval &blk include m end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin testing require 'test/unit' class TCModule < Test::Unit::TestCase module M def x ; 1 ; end end class C integrate M do rename :y, :x end end def test_integrate c = C.new assert_raises( NoMethodError ) { c.x } assert_equal( 1, c.y ) end end =end