[Bps-public-commit] r18909 - Shipwright/trunk/lib/Shipwright/Backend
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sun Mar 22 04:52:32 EDT 2009
Author: sunnavy
Date: Sun Mar 22 04:52:32 2009
New Revision: 18909
Modified:
Shipwright/trunk/lib/Shipwright/Backend/Base.pm
Log:
let graph_deps returns the output instead of just printing it
Modified: Shipwright/trunk/lib/Shipwright/Backend/Base.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend/Base.pm (original)
+++ Shipwright/trunk/lib/Shipwright/Backend/Base.pm Sun Mar 22 04:52:32 2009
@@ -357,7 +357,7 @@
=item graph_deps
-Output a dependency graph in graphviz format to stdout
+return a dependency graph in graphviz format
=cut
@@ -380,18 +380,19 @@
$self->_fill_deps( %args, require => $require, name => $distname );
}
- print 'digraph g {
+ my $out = 'digraph g {
graph [ overlap = scale, rankdir= LR ];
node [ fontsize = "18", shape = record, fontsize = 18 ];
';
for my $dist (@dists) {
- print qq{ "$dist" [shape = record, fontsize = 18, label = "$dist" ];\n};
+ $out .= qq{ "$dist" [shape = record, fontsize = 18, label = "$dist" ];\n};
for my $dep ( @{ $require->{$dist} } ) {
- print qq{"$dist" -> "$dep";\n};
+ $out .= qq{"$dist" -> "$dep";\n};
}
}
- print "\n};\n";
+ $out .= "\n};";
+ return $out;
}
sub _fill_deps {
More information about the Bps-public-commit
mailing list