actually commit FakeMetaClass.pm
Matt S Trout [Tue, 26 Jun 2012 18:33:28 +0000 (18:33 +0000)]
lib/Moo/HandleMoose/FakeMetaClass.pm [new file with mode: 0644]

diff --git a/lib/Moo/HandleMoose/FakeMetaClass.pm b/lib/Moo/HandleMoose/FakeMetaClass.pm
new file mode 100644 (file)
index 0000000..04db750
--- /dev/null
@@ -0,0 +1,20 @@
+package Moo::HandleMoose::FakeMetaClass;
+
+sub DESTROY { }
+
+sub AUTOLOAD {
+  my ($meth) = (our $AUTOLOAD =~ /([^:]+)$/);
+  require Moo::HandleMoose;
+  Moo::HandleMoose::inject_real_metaclass_for((shift)->{name})->$meth(@_)
+}
+sub can {
+  require Moo::HandleMoose;
+  Moo::HandleMoose::inject_real_metaclass_for((shift)->{name})->can(@_)
+}
+sub isa {
+  require Moo::HandleMoose;
+  Moo::HandleMoose::inject_real_metaclass_for((shift)->{name})->isa(@_)
+}
+sub make_immutable { $_[0] }
+
+1;