Revision history for Bit-MorseSignals
-0.03 2008-03-03 17:30 GMT
+0.04 2008-03-06 14:55 UTC
+ + Doc : POD tweaks.
+ + Fix : Correct dependencies listing in META.yml.
+ + Fix : Demanglers panicking over misformed data caused severe warnings.
+
+0.03 2008-03-03 17:30 UTC
+ Doc : Clarified synopsises.
+ Fix : The receiver could access inexistant demanglers if an error
occurred during the transfer.
-0.02 2008-03-01 12:00 GMT
+0.02 2008-03-01 12:00 UTC
+ Add : The samples/jerk.pl example script.
+ Doc : Typos in POD.
+ Fix : As the doc says, the datatype should be enforced to PLAIN when
the reserved bit is set.
-0.01 2008-03-01 10:40 GMT
+0.01 2008-03-01 10:40 UTC
First version, released on an unsuspecting world.
--- #YAML:1.0
name: Bit-MorseSignals
-version: 0.03
+version: 0.04
abstract: The MorseSignals protocol.
license: perl
author:
Encode: 0
Exporter: 0
Storable: 0
- Test::More: 0
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
version: 1.3
+build_requires:
+ ExtUtils::MakeMaker: 0
+ Test::More: 0
+ utf8: 0
use warnings;
use ExtUtils::MakeMaker;
+my $BUILD_REQUIRES = {
+ 'utf8' => 0,
+ 'ExtUtils::MakeMaker' => 0,
+ 'Test::More' => 0,
+};
+
+sub build_req {
+ my $tometa = ' >> $(DISTVNAME)/META.yml;';
+ my $build_req = 'echo "build_requires:" ' . $tometa;
+ foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
+ my $ver = $BUILD_REQUIRES->{$mod};
+ $build_req .= sprintf 'echo " %-30s %s" %s', "$mod:", $ver, $tometa;
+ }
+ return $build_req;
+}
+
WriteMakefile(
NAME => 'Bit::MorseSignals',
AUTHOR => 'Vincent Pit <perl@profvince.com>',
'Encode' => 0,
'Exporter' => 0,
'Storable' => 0,
- 'Test::More' => 0,
},
dist => {
- PREOP => 'pod2text lib/Bit/MorseSignals.pm > $(DISTVNAME)/README',
+ PREOP => 'pod2text lib/Bit/MorseSignals.pm > $(DISTVNAME)/README; '
+ . build_req,
COMPRESS => 'gzip -9f', SUFFIX => 'gz'
},
clean => { FILES => 'Bit-MorseSignals-*' },
Bit::MorseSignals - The MorseSignals protocol.
VERSION
- Version 0.03
+ Version 0.04
SYNOPSIS
use Bit::MorseSignals::Emitter;
=head1 VERSION
-Version 0.03
+Version 0.04
=cut
-our $VERSION = '0.03';
+our $VERSION = '0.04';
=head1 SYNOPSIS
=head1 VERSION
-Version 0.03
+Version 0.04
=cut
-our $VERSION = '0.03';
+our $VERSION = '0.04';
=head1 SYNOPSIS
return $self;
}
-=head2 C<< post $msg, [ type => $type ] >>
+=head2 C<< post $msg, < type => $type > >>
Adds C<$msg> to the message queue and, if no other message is currently processed, dequeue the oldest item and prepare it. The type is automatically chosen, but you may want to try to force it with the C<type> option : C<$type> is then one of the C<BM_DATA_*> constants listed in L<Bit::MorseSignals/CONSTANTS>
=head1 VERSION
-Version 0.03
+Version 0.04
=cut
-our $VERSION = '0.03';
+our $VERSION = '0.04';
=head1 SYNOPSIS
=head1 METHODS
-=head2 C<< new [ done => $cb ] >>
+=head2 C<< new < done => $cb > >>
L<Bit::MorseSignals::Receiver> object constructor. With the C<'done'> option, you can specify a callback that will be triggered every time a message is completed, and in which C<$_[0]> will be the receiver object and C<$_[1]> the message received.
my @demanglers = (sub { $_[0] }, \&decode_utf8, \&thaw );
# BM_DATA_{PLAIN, UTF8, STORABLE}
$self->{msg} = defined $demanglers[$self->{type}]
- ? $demanglers[$self->{type}]->($self->{buf})
+ ? do {
+ my $msg = eval {
+ $demanglers[$self->{type}]->($self->{buf})
+ };
+ $@ ? undef : $msg;
+ }
: $self->{buf};
$self->reset;
$self->{done}->($self, $self->{msg}) if $self->{done};