From 88a131d89c33a82344954420a1dc1da28246fba1 Mon Sep 17 00:00:00 2001 From: "Andreas J. Koenig" Date: Sun, 29 Mar 2009 19:04:08 +0200 Subject: [PATCH] verbose(X) on a Recent object now calls verbose(X) on all associated Recentfile objects --- Changes | 10 ++++++++++ lib/File/Rsync/Mirror/Recent.pm | 26 +++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index e5f64b8..b9e1b8b 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,13 @@ +2009-03-29 Andreas J. Koenig + + * release 0.0.2 + + * Bugfix: reflecting in the test that when JSON is not installed + Data::Serializer::JSON won't work + + * convenience: verbose(X) on a Recent object now calls verbose(X) on all + associated Recentfile objects. + 2009-03-25 Andreas J. Koenig * release 0.0.1 diff --git a/lib/File/Rsync/Mirror/Recent.pm b/lib/File/Rsync/Mirror/Recent.pm index 206ec23..0012c94 100644 --- a/lib/File/Rsync/Mirror/Recent.pm +++ b/lib/File/Rsync/Mirror/Recent.pm @@ -138,10 +138,10 @@ File::Rsync object used to run the mirror. Minimum time before fetching the principal recentfile again. -=item verbose +=item _verbose -Boolean to turn on a bit verbosity. This is in experimental stage, we -will have to decide which output we want when the dust has settled. +Boolean to turn on a bit verbosity. Use the method C to also +set the verbosity of associated Recentfile objects. =back @@ -699,6 +699,26 @@ sub _fetch_as_tempfile { return $fh->filename; } +=head1 $verbose = $obj->verbose ( $set ) + +Getter/setter method to set verbosity for this object and all +associated Recentfile objects. + +=cut +sub verbose { + my($self,$set) = @_; + if (defined $set) { + for ( @{$self->recentfiles} ) { $_->verbose($set) } + $self->_verbose ($set); + } + my $x = $self->_verbose; + unless (defined $x) { + $x = 0; + $self->_verbose ($x); + } + return $x; + +} =head1 THE ARCHITECTURE OF A COLLECTION OF RECENTFILES -- 2.11.4.GIT