From a05144844ce1919ec4bc70529d84a0a254600e0a Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Tue, 8 Apr 2014 13:58:39 -0700 Subject: [PATCH] ignore init in pod documentation add pod documentation --- lib/Term/ProgressBar/IO.pm | 53 ++++++++++++++++++++++++++++++++++++++ t/pod-coverage.t | 3 ++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/lib/Term/ProgressBar/IO.pm b/lib/Term/ProgressBar/IO.pm index 0617baf..b95ab6f 100644 --- a/lib/Term/ProgressBar/IO.pm +++ b/lib/Term/ProgressBar/IO.pm @@ -14,6 +14,7 @@ Term::ProgressBar::IO -- Display a progress bar while reading from a seekable fi my $pb = Term::ProgressBar::IO->new($fh); while (<$fh>) { + # do something $pb->update(); } @@ -22,6 +23,9 @@ Term::ProgressBar::IO -- Display a progress bar while reading from a seekable fi Displays a progress bar using L which corresponds to reading from a filehandle. +This module inherits from L and has all of its +options. + =head1 BUGS None known. @@ -41,6 +45,33 @@ BEGIN{ $DEBUG = 0 unless defined $DEBUG; } +=head1 METHODS + +=head2 new + +Create and return a new Term::ProgressBar::IO instance. + +=over + +=item ARGUMENTS + +=over + +=item count + +A valid filehandle or item count. L filehandles are +also properly handled. + +=item OTHER ARGUMENTS + +All other arguments are documented in L + +=back + +=back + +=cut + sub init { my $self = shift; my $count; @@ -67,6 +98,28 @@ sub init { $self->SUPER::init(\%config); } +=head2 update + +Automatically update the progress bar based on the position of the +filehandle given at construction time. + +=over + +=item ARGUMENTS + +=over + +=item so_far + +Current progress point; this defaults to the current position of the +filehandle. [You probably don't actually want to ever give this.] + +=back + +=back + +=cut + sub update { my $self = shift; my $count = $self->__determine_count(); diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 866fac2..103b819 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -17,4 +17,5 @@ eval "use Pod::Coverage $min_pc"; plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; -all_pod_coverage_ok(); +all_pod_coverage_ok({also_private => ['init'], + }); -- 2.39.2