[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.3.4-50-g7610c46



The following commit has been merged in the master branch:
commit 7610c462eddc301c5d0c63075f87b61da7acf67c
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Sun Mar 21 01:03:33 2010 -0600

    Add missing documentation for some methods
    
    Also test Lintian::DepMap::Properties for 100% POD coverage.

diff --git a/lib/Lintian/DepMap.pm b/lib/Lintian/DepMap.pm
index 1cd2466..dc69ea8 100644
--- a/lib/Lintian/DepMap.pm
+++ b/lib/Lintian/DepMap.pm
@@ -159,6 +159,19 @@ sub add {
     } else { 1; }
 }
 
+=item addp(node[, prefix, dependency[, dependency[, ...]]])
+
+Adds the given C<node> to the map marking any third or more parameters,
+after prefixing them with C<prefix>, as its dependencies. E.g.
+
+    # pA and pB have no dependency:
+    $map->add('pA');
+    $map->add('pA');
+    # C depends on pA and pB:
+    $map->addp('C', 'p', 'A', 'B');
+
+=cut
+
 sub addp {
     my ($self,$node,$prefix) = (shift,shift,shift);
     my @deps;
@@ -225,6 +238,23 @@ sub satisfy {
     delete $self->{'nodes'}{$node};
 }
 
+=item done(node)
+
+Returns whether the given C<node> has been satisfied/done.
+
+E.g.
+
+    # A has no dependencies:
+    $map->add('A');
+    # we work on A, and we are done:
+    $map->satisfy('A');
+
+    print "A is done!"
+	if ($map->done('A'));
+
+=cut
+
+
 sub done {
     my $self = shift;
     my $node = shift;
diff --git a/lib/Lintian/DepMap/Properties.pm b/lib/Lintian/DepMap/Properties.pm
index 7d4335d..b26aee0 100644
--- a/lib/Lintian/DepMap/Properties.pm
+++ b/lib/Lintian/DepMap/Properties.pm
@@ -80,6 +80,21 @@ sub add {
     return $self->SUPER::add(@_);
 }
 
+=item addp(node[, prefix, dependency[, dependency...]], [ref to property])
+
+Adds the given C<node> to the map marking any third or more parameters,
+after prefixing them with C<prefix>, as its dependencies and sets the
+C<node>'s property to the ref, if defined. See add()'s description for
+more information about about properties. E.g.
+
+    # pA and pB have no dependency:
+    $map->addp('pA', {name => 'John Doe'});
+    $map->addp('pB', {name => 'Jane Doe'});
+    # Df depends on pA and pB:
+    $map->addp('Df', 'p', 'A', 'B', {name => 'Doe Family'});
+
+=cut
+
 sub addp {
     my $self = shift;
     my $ref = pop;
diff --git a/t/scripts/pod-coverage.t b/t/scripts/pod-coverage.t
index 4b472f0..4623af2 100755
--- a/t/scripts/pod-coverage.t
+++ b/t/scripts/pod-coverage.t
@@ -13,17 +13,18 @@ plan skip_all => 'Test::Pod::Coverage is required for testing POD coverage'
 # add underscores; personally, I (rra) think they make the code hard to read.
 our %MODULES =
     (
-     'Lintian::Check'             => [],
-     'Lintian::Collect'           => [],
-     'Lintian::Command'           => [],
-     'Lintian::Command::Simple'   => [],
-     'Lintian::Data'              => [],
-     'Lintian::DepMap'            => [],
-     'Lintian::Relation'          => [ qr/^parse_element$/,
-                                       qr/^implies_(element|array)/ ],
-     'Lintian::Relation::Version' => [ qr/^compare$/ ],
-     'Lintian::Tags'              => [],
-     'Lintian::Tag::Info'         => [],
+     'Lintian::Check'              => [],
+     'Lintian::Collect'            => [],
+     'Lintian::Command'            => [],
+     'Lintian::Command::Simple'    => [],
+     'Lintian::Data'               => [],
+     'Lintian::DepMap'             => [],
+     'Lintian::DepMap::Properties' => [],
+     'Lintian::Relation'           => [ qr/^parse_element$/,
+                                        qr/^implies_(element|array)/ ],
+     'Lintian::Relation::Version'  => [ qr/^compare$/ ],
+     'Lintian::Tags'               => [],
+     'Lintian::Tag::Info'          => [],
     );
 # TODO:
 #		Lintian::Collect::Binary

-- 
Debian package checker


Reply to: