From: Vincent Pit Date: Sun, 29 Jun 2008 15:12:53 +0000 (+0200) Subject: Importing Bit-MorseSignals-0.04.tar.gz X-Git-Tag: v0.04^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=0288f57c6aaf2cb133df80f13d78af66ea094902;p=perl%2Fmodules%2FBit-MorseSignals.git Importing Bit-MorseSignals-0.04.tar.gz --- diff --git a/Changes b/Changes index 1d01650..4fa24df 100644 --- a/Changes +++ b/Changes @@ -1,16 +1,21 @@ 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. diff --git a/META.yml b/META.yml index e8f8bd9..0b4087a 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Bit-MorseSignals -version: 0.03 +version: 0.04 abstract: The MorseSignals protocol. license: perl author: @@ -12,7 +12,10 @@ requires: 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 diff --git a/Makefile.PL b/Makefile.PL index 38a01ab..00a7532 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,6 +2,22 @@ use strict; 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 ', @@ -14,10 +30,10 @@ WriteMakefile( '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-*' }, diff --git a/README b/README index 4d6bd1a..167f19d 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Bit::MorseSignals - The MorseSignals protocol. VERSION - Version 0.03 + Version 0.04 SYNOPSIS use Bit::MorseSignals::Emitter; diff --git a/lib/Bit/MorseSignals.pm b/lib/Bit/MorseSignals.pm index d06a353..2f5b167 100644 --- a/lib/Bit/MorseSignals.pm +++ b/lib/Bit/MorseSignals.pm @@ -9,11 +9,11 @@ Bit::MorseSignals - The MorseSignals protocol. =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 SYNOPSIS diff --git a/lib/Bit/MorseSignals/Emitter.pm b/lib/Bit/MorseSignals/Emitter.pm index 34862f0..0bf93b0 100644 --- a/lib/Bit/MorseSignals/Emitter.pm +++ b/lib/Bit/MorseSignals/Emitter.pm @@ -15,11 +15,11 @@ Bit::MorseSignals::Emitter - Base class for Bit::MorseSignals emitters. =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 SYNOPSIS @@ -81,7 +81,7 @@ sub new { 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 option : C<$type> is then one of the C constants listed in L diff --git a/lib/Bit/MorseSignals/Receiver.pm b/lib/Bit/MorseSignals/Receiver.pm index 6c13004..87c0a5b 100644 --- a/lib/Bit/MorseSignals/Receiver.pm +++ b/lib/Bit/MorseSignals/Receiver.pm @@ -15,11 +15,11 @@ Bit::MorseSignals::Receiver - Base class for Bit::MorseSignals receivers. =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 SYNOPSIS @@ -46,7 +46,7 @@ sub _check_self { =head1 METHODS -=head2 C<< new [ done => $cb ] >> +=head2 C<< new < done => $cb > >> L 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. @@ -99,7 +99,12 @@ sub push { 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};