[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88

Tomas Doran bobtfish at bobtfish.net
Mon May 6 11:56:50 UTC 2013


The following commit has been merged in the master branch:
commit d414cb469bb35ef142610934cbf7af02a48afe7a
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sun Apr 15 17:31:02 2012 +0100

    Lets have a type library

diff --git a/lib/Log/Stash/Role/Input.pm b/lib/Log/Stash/Role/Input.pm
index 9dfa58b..6343932 100644
--- a/lib/Log/Stash/Role/Input.pm
+++ b/lib/Log/Stash/Role/Input.pm
@@ -1,21 +1,11 @@
 package Log::Stash::Role::Input;
 use Moose::Role;
 use JSON qw/ from_json /;
-use Moose::Util::TypeConstraints;
+use Log::Stash::Types;
 use namespace::autoclean;
 
 sub decode { from_json( $_[1], { utf8  => 1 } ) }
 
-role_type 'Log::Stash::Role::Output';
-coerce 'Log::Stash::Role::Output',
-    from 'HashRef',
-    via {
-        my %stuff = %$_;
-        my $class = delete($stuff{class});
-        Class::MOP::load_class($class);
-        $class->new(%stuff);
-    };
-
 has output_to => (
     does => 'Log::Stash::Role::Output',
     is => 'ro',
diff --git a/lib/Log/Stash/Types.pm b/lib/Log/Stash/Types.pm
new file mode 100644
index 0000000..1fbfd08
--- /dev/null
+++ b/lib/Log/Stash/Types.pm
@@ -0,0 +1,22 @@
+package Log::Stash::Types;
+use MooseX::Types ();
+use Moose::Util::TypeConstraints;
+
+role_type $_ for map { "Log::Stash::Role::$_" }
+    qw/
+        Input
+        Filter
+        Output
+    /;
+
+coerce 'Log::Stash::Role::Output',
+    from 'HashRef',
+    via {
+        my %stuff = %$_;
+        my $class = delete($stuff{class});
+        Class::MOP::load_class($class);
+        $class->new(%stuff);
+    };
+
+1;
+

-- 
libmessage-passing-perl Debian packaging



More information about the Pkg-perl-cvs-commits mailing list