File Coverage

lib/DataFlow/Proc/MessagePack.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package DataFlow::Proc::MessagePack;
2              
3 1     1   44059 use strict;
  1         2  
  1         37  
4 1     1   6 use warnings;
  1         1  
  1         79  
5              
6             # ABSTRACT: A MessagePack converting processor
7              
8             our $VERSION = '1.112100'; # VERSION
9              
10 1     1   739 use Moose;
  0            
  0            
11             extends 'DataFlow::Proc::Converter';
12              
13             use namespace::autoclean;
14             use Data::MessagePack;
15              
16             sub _policy {
17             return shift->direction eq 'CONVERT_TO' ? 'ArrayRef' : 'Scalar';
18             }
19              
20             has '+converter' => (
21             lazy => 1,
22             default => sub {
23             my $self = shift;
24             return $self->has_converter_opts
25             ? Data::MessagePack->new( $self->converter_opts )
26             : Data::MessagePack->new;
27             },
28             'handles' => {
29             'msgpack' => sub { shift->converter(@_) },
30             'msgpack_opts' => sub { shift->converter_opts(@_) },
31             'has_msgpack_opts' => sub { shift->has_converter_opts },
32             },
33             'init_arg' => 'msgpack',
34             );
35              
36             has '+converter_opts' => ( 'init_arg' => 'msgpack_opts', );
37              
38             sub _build_subs {
39             my $self = shift;
40              
41             my $subs = {
42             'TO_MSGPACK' => sub {
43             return $self->msgpack->pack($_);
44             },
45             'FROM_MSGPACK' => sub {
46             return $self->msgpack->unpack($_);
47             },
48             };
49              
50             return $subs;
51             }
52              
53             __PACKAGE__->meta->make_immutable;
54              
55             1;
56              
57             __END__
58             =pod
59              
60             =encoding utf-8
61              
62             =head1 NAME
63              
64             DataFlow::Proc::MessagePack - A MessagePack converting processor
65              
66             =head1 VERSION
67              
68             version 1.112100
69              
70             =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders
71              
72             =head1 SUPPORT
73              
74             =head2 Perldoc
75              
76             You can find documentation for this module with the perldoc command.
77              
78             perldoc DataFlow::Proc::MessagePack
79              
80             =head2 Websites
81              
82             The following websites have more information about this module, and may be of help to you. As always,
83             in addition to those websites please use your favorite search engine to discover more resources.
84              
85             =over 4
86              
87             =item *
88              
89             Search CPAN
90              
91             The default CPAN search engine, useful to view POD in HTML format.
92              
93             L<http://search.cpan.org/dist/DataFlow-Proc-MessagePack>
94              
95             =item *
96              
97             AnnoCPAN
98              
99             The AnnoCPAN is a website that allows community annonations of Perl module documentation.
100              
101             L<http://annocpan.org/dist/DataFlow-Proc-MessagePack>
102              
103             =item *
104              
105             CPAN Ratings
106              
107             The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.
108              
109             L<http://cpanratings.perl.org/d/DataFlow-Proc-MessagePack>
110              
111             =item *
112              
113             CPAN Forum
114              
115             The CPAN Forum is a web forum for discussing Perl modules.
116              
117             L<http://cpanforum.com/dist/DataFlow-Proc-MessagePack>
118              
119             =item *
120              
121             CPANTS
122              
123             The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
124              
125             L<http://cpants.perl.org/dist/overview/DataFlow-Proc-MessagePack>
126              
127             =item *
128              
129             CPAN Testers
130              
131             The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions.
132              
133             L<http://www.cpantesters.org/distro/D/DataFlow-Proc-MessagePack>
134              
135             =item *
136              
137             CPAN Testers Matrix
138              
139             The CPAN Testers Matrix is a website that provides a visual way to determine what Perls/platforms PASSed for a distribution.
140              
141             L<http://matrix.cpantesters.org/?dist=DataFlow-Proc-MessagePack>
142              
143             =back
144              
145             =head2 Email
146              
147             You can email the author of this module at C<RUSSOZ at cpan.org> asking for help with any problems you have.
148              
149             =head2 Internet Relay Chat
150              
151             You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is,
152             please read this excellent guide: L<http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please
153             be courteous and patient when talking to us, as we might be busy or sleeping! You can join
154             those networks/channels and get help:
155              
156             =over 4
157              
158             =item *
159              
160             irc.perl.org
161              
162             You can connect to the server at 'irc.perl.org' and join this channel: #sao-paulo.pm then talk to this person for help: russoz.
163              
164             =back
165              
166             =head2 Bugs / Feature Requests
167              
168             Please report any bugs or feature requests by email to C<bug-dataflow-proc-messagepack at rt.cpan.org>, or through
169             the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DataFlow-Proc-MessagePack>. You will be automatically notified of any
170             progress on the request by the system.
171              
172             =head2 Source Code
173              
174             The code is open to the world, and available for you to hack on. Please feel free to browse it and play
175             with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull
176             from your repository :)
177              
178             L<https://github.com/russoz/DataFlow-Proc-MessagePack>
179              
180             git clone https://github.com/russoz/DataFlow-Proc-MessagePack
181              
182             =head1 AUTHOR
183              
184             Alexei Znamensky <russoz@cpan.org>
185              
186             =head1 COPYRIGHT AND LICENSE
187              
188             This software is copyright (c) 2011 by Alexei Znamensky.
189              
190             This is free software; you can redistribute it and/or modify it under
191             the same terms as the Perl 5 programming language system itself.
192              
193             =head1 BUGS AND LIMITATIONS
194              
195             No bugs have been reported.
196              
197             Please report any bugs or feature requests through the web interface at
198             L<http://rt.cpan.org>.
199              
200             =head1 DISCLAIMER OF WARRANTY
201              
202             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
203             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
204             WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
205             PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
206             EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
207             IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
208             PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
209             SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME
210             THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
211              
212             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
213             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
214             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
215             TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
216             CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
217             SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
218             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
219             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
220             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
221             DAMAGES.
222              
223             =cut
224