From: Vincent Pit Date: Sun, 29 Jun 2008 15:12:55 +0000 (+0200) Subject: Importing Bit-MorseSignals-0.05.tar.gz X-Git-Tag: v0.05^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;ds=inline;h=8ce9fd9d5f4e6197d1a33a3fd11953cc1dc3b31f;p=perl%2Fmodules%2FBit-MorseSignals.git Importing Bit-MorseSignals-0.05.tar.gz --- diff --git a/Changes b/Changes index 4fa24df..7dfb548 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for Bit-MorseSignals +0.05 2008-03-13 23:05 UTC + + Add : The len and pos emitter methods. + + Fix : The usual set of POD typos. + + Fix : Propagate demangler errors as warnings. + + Tst : Small improvments. + 0.04 2008-03-06 14:55 UTC + Doc : POD tweaks. + Fix : Correct dependencies listing in META.yml. diff --git a/META.yml b/META.yml index 0b4087a..ce749cd 100644 --- a/META.yml +++ b/META.yml @@ -1,11 +1,11 @@ --- #YAML:1.0 name: Bit-MorseSignals -version: 0.04 +version: 0.05 abstract: The MorseSignals protocol. license: perl author: - Vincent Pit -generated_by: ExtUtils::MakeMaker version 6.44 +generated_by: ExtUtils::MakeMaker version 6.42 distribution_type: module requires: Carp: 0 diff --git a/Makefile.PL b/Makefile.PL index 00a7532..c1e4b26 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,22 +19,22 @@ sub build_req { } WriteMakefile( - NAME => 'Bit::MorseSignals', - AUTHOR => 'Vincent Pit ', - LICENSE => 'perl', - VERSION_FROM => 'lib/Bit/MorseSignals.pm', - ABSTRACT_FROM => 'lib/Bit/MorseSignals.pm', - PL_FILES => {}, - PREREQ_PM => { - 'Carp' => 0, - 'Encode' => 0, - 'Exporter' => 0, - 'Storable' => 0, + NAME => 'Bit::MorseSignals', + AUTHOR => 'Vincent Pit ', + LICENSE => 'perl', + VERSION_FROM => 'lib/Bit/MorseSignals.pm', + ABSTRACT_FROM => 'lib/Bit/MorseSignals.pm', + PL_FILES => {}, + PREREQ_PM => { + 'Carp' => 0, + 'Encode' => 0, + 'Exporter' => 0, + 'Storable' => 0, }, - dist => { - PREOP => 'pod2text lib/Bit/MorseSignals.pm > $(DISTVNAME)/README; ' - . build_req, - COMPRESS => 'gzip -9f', SUFFIX => 'gz' + dist => { + PREOP => 'pod2text lib/Bit/MorseSignals.pm > $(DISTVNAME)/README; ' + . build_req, + COMPRESS => 'gzip -9f', SUFFIX => 'gz' }, - clean => { FILES => 'Bit-MorseSignals-*' }, + clean => { FILES => 'Bit-MorseSignals-*' }, ); diff --git a/README b/README index 167f19d..4f57451 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Bit::MorseSignals - The MorseSignals protocol. VERSION - Version 0.04 + Version 0.05 SYNOPSIS use Bit::MorseSignals::Emitter; @@ -25,7 +25,7 @@ DESCRIPTION An actual implementation is also provided : Bit::MorseSignals::Emitter is a base class for emitters ; - Bit::MorseSignals::Receiver is a base class for receivers ; + Bit::MorseSignals::Receiver is a base class for receivers. Go to those pages if you just want the stuff done and don't care about how it gets there. diff --git a/lib/Bit/MorseSignals.pm b/lib/Bit/MorseSignals.pm index 2f5b167..3add7d6 100644 --- a/lib/Bit/MorseSignals.pm +++ b/lib/Bit/MorseSignals.pm @@ -9,11 +9,11 @@ Bit::MorseSignals - The MorseSignals protocol. =head1 VERSION -Version 0.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; =head1 SYNOPSIS @@ -36,7 +36,7 @@ An actual implementation is also provided : =item L is a base class for emitters ; -=item L is a base class for receivers ; +=item L is a base class for receivers. =back diff --git a/lib/Bit/MorseSignals/Emitter.pm b/lib/Bit/MorseSignals/Emitter.pm index 0bf93b0..441e6e4 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.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; =head1 SYNOPSIS @@ -176,6 +176,30 @@ sub pop { return $bit; } +=head2 C + +The length of the currently posted message. + +=cut + +sub len { + my ($self) = @_; + _check_self($self); + return $self->{len}; +} + +=head2 C + +The number of bits that have already been sent for the current message. + +=cut + +sub pos { + my ($self) = @_; + _check_self($self); + return $self->{pos}; +} + =head2 C Cancels the current transfer, but does not empty the queue. diff --git a/lib/Bit/MorseSignals/Receiver.pm b/lib/Bit/MorseSignals/Receiver.pm index 87c0a5b..a829f36 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.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; =head1 SYNOPSIS @@ -101,6 +101,7 @@ sub push { $self->{msg} = defined $demanglers[$self->{type}] ? do { my $msg = eval { + local $SIG{__DIE__} = sub { warn @_ }; $demanglers[$self->{type}]->($self->{buf}) }; $@ ? undef : $msg; diff --git a/t/02-can.t b/t/02-can.t index dc87461..f29e636 100644 --- a/t/02-can.t +++ b/t/02-can.t @@ -3,11 +3,11 @@ use strict; use warnings; -use Test::More tests => 7 + 5; +use Test::More tests => 9 + 5; require Bit::MorseSignals::Emitter; -for (qw/new post pop reset flush busy queued/) { +for (qw/new post pop len pos reset flush busy queued/) { ok(Bit::MorseSignals::Emitter->can($_), 'BME can ' . $_); } diff --git a/t/92-pod-coverage.t b/t/92-pod-coverage.t index c3c08e2..b4aff52 100644 --- a/t/92-pod-coverage.t +++ b/t/92-pod-coverage.t @@ -8,16 +8,14 @@ use Test::More; # Ensure a recent version of Test::Pod::Coverage my $min_tpc = 1.08; eval "use Test::Pod::Coverage $min_tpc"; -plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" - if $@; +plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" if $@; # Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, # but older versions don't recognize some common documentation styles my $min_pc = 0.18; eval "use Pod::Coverage $min_pc"; -plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" - if $@; +plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; all_pod_coverage_ok( - also_private => [ qr/^_/ ] + { also_private => [ qr/^_/ ] } );