[libbread-board-perl] 35/66: just remove the graphviz stuff, it's a pain
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 21:23:36 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libbread-board-perl.
commit 3420a6799326912b14de755f5b81d16e30226a98
Author: Jesse Luehrs <doy at tozt.net>
Date: Thu Aug 1 14:05:36 2013 -0400
just remove the graphviz stuff, it's a pain
<stevan> doy: if you want to kill the Graphviz stuff that is fine
---
.travis.yml | 4 +-
.travis/GraphViz.pm | 3 -
bin/visualize-breadboard | 53 -------------
dist.ini | 13 ----
lib/Bread/Board/GraphViz.pm | 158 ---------------------------------------
lib/Bread/Board/GraphViz/App.pm | 54 -------------
t/500_graphviz.t | 38 ----------
7 files changed, 2 insertions(+), 321 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 03e54af..e9f133b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,6 @@ perl:
install:
- cpanm -q --notest Dist::Zilla
- dzil authordeps --missing | cpanm -q --notest
- - dzil listdeps --author --missing | grep -v GraphViz | cpanm -q --notest
+ - dzil listdeps --author --missing | cpanm -q --notest
script:
- - PERL5LIB=${PWD}/.travis dzil test --all
+ - dzil test --all
diff --git a/.travis/GraphViz.pm b/.travis/GraphViz.pm
deleted file mode 100644
index 0f3db9e..0000000
--- a/.travis/GraphViz.pm
+++ /dev/null
@@ -1,3 +0,0 @@
-package GraphViz;
-
-1;
diff --git a/bin/visualize-breadboard b/bin/visualize-breadboard
deleted file mode 100755
index c0f1070..0000000
--- a/bin/visualize-breadboard
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-# PODNAME: visualize-breadboard
-# ABSTRACT: script to invoke L<Bread::Board::GraphViz::App>
-
-use FindBin qw($Bin);
-use lib "$Bin/../lib";
-
-# these make the app much easier to use
-use lib ".";
-use lib "lib";
-
-use MooseX::Runnable::Run 'Bread::Board::GraphViz::App';
-
-__END__
-
-=pod
-
-=head1 SYNOPSIS
-
- $ visualize-breadboard 'use MyApp; MyApp->get_breadboard'
-
-Given a piece of Perl code to evaluate, this application prints the
-dot markup representing the dependency graph of the
-L<Bread::Board::Container> that the code returned.
-
-=head1 SEE ALSO
-
-L<Bread::Board::GraphViz::App>
-
-L<Bread::Board>
-
-=head1 BUGS
-
-All complex software has bugs lurking in it, and this module is no
-exception. If you find a bug please either email me, or add the bug
-to cpan-RT.
-
-=head1 AUTHOR
-
-Jonathan Rockway - C<< <jrockway at cpan.org> >>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2007-2011 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
diff --git a/dist.ini b/dist.ini
index c3073f1..a502559 100644
--- a/dist.ini
+++ b/dist.ini
@@ -12,14 +12,8 @@ github_name = BreadBoard
bugtracker_web = https://github.com/stevan/BreadBoard/issues
bugtracker_mailto =
authority = cpan:STEVAN
-Test::Compile_skip = visualize
[AutoPrereqs]
-skip = Data::Visitor::Callback
-skip = GraphViz
-skip = MooseX::Runnable
-skip = MooseX::Types::Set::Object
-skip = Set::Object
skip = ^(?:Foo|Bar|Baz|My)\b
skip = ^(?:Chair|Desk|Employee)\b
skip = Logger::Role
@@ -31,11 +25,4 @@ Moose = 1.00
MooseX::Clone = 0.05
MooseX::Params::Validate = 0.14
-[Prereqs / RuntimeRecommends]
-Data::Visitor::Callback = 0
-GraphViz = 0
-MooseX::Runnable = 0
-MooseX::Types::Set::Object = 0
-Set::Object = 0
-
[ContributorsFromGit]
diff --git a/lib/Bread/Board/GraphViz.pm b/lib/Bread/Board/GraphViz.pm
deleted file mode 100644
index 5b47264..0000000
--- a/lib/Bread/Board/GraphViz.pm
+++ /dev/null
@@ -1,158 +0,0 @@
-package Bread::Board::GraphViz;
-use Moose;
-# ABSTRACT: visualize L<Bread::Board> dependency graphs
-
-use Data::Visitor::Callback;
-use GraphViz;
-use List::Util qw(reduce);
-use MooseX::Types::Set::Object;
-use Set::Object qw(set);
-
-# edges is built incrementally, as a user may provide many "root" containers
-has 'edges' => (
- init_arg => 'edges', # feel free to supply your own
- isa => 'ArrayRef[HashRef]',
- traits => ['Array'],
- default => sub { [] },
- handles => {
- edges => 'elements',
- push_edge => 'push',
- },
-);
-
-has 'services' => (
- isa => 'Set::Object',
- default => sub { set },
- handles => {
- push_service => 'insert',
- services => 'members',
- },
-);
-
-has 'visitor' => (
- isa => 'Data::Visitor::Callback',
- lazy_build => 1,
- handles => {
- add_container => 'visit',
- },
-);
-
-sub service_name {
- my $service = shift;
- return '/' . $service->name
- if $service->parent == $service->get_root_container;
- return join '/', service_name($service->parent), $service->name;
-}
-
-sub name_prefix {
- my ($self) = @_;
- return reduce {
- my $i = 0;
- for(;substr($a, $i, 1) eq substr($b, $i, 1); $i++){}
- substr $a, 0, $i;
- } map { service_name($_) } $self->services;
-}
-
-sub _build_visitor {
- my ($self) = @_;
-
- my $v = Data::Visitor::Callback->new(
- 'Bread::Board::Container' => sub {
- for my $c ($_->get_sub_container_list){
- $_[0]->visit($_->get_sub_container($c));
- }
- for my $s ($_->get_service_list) {
- $_[0]->visit($_->get_service($s));
- }
- return $_;
- },
- 'object' => sub {
- if($_->does('Bread::Board::Service')){
- $self->push_service($_);
- }
-
- if($_->does('Bread::Board::Service::WithDependencies')){
- for my $dep (map { $_->[1] } $_->get_all_dependencies){
- $self->push_edge({
- from => service_name($_),
- to => service_name($dep->service),
- via => $dep->service_name,
- });
- }
- }
- return $_;
- },
- );
- return $v;
-}
-
-sub graph {
- my ($self, $viz, %params) = @_;
- $viz ||= GraphViz->new;
-
- my $prefix = $self->name_prefix;
- my $fix = sub {
- substr $_[0], length($prefix);
- };
-
- for my $service ($self->services) {
- $viz->add_node(
- $fix->(service_name($service)),
- fontsize => 12,
- shape => $service->does('Bread::Board::LifeCycle::Singleton') ?
- 'ellipse' : 'box',
- );
- }
-
- for my $edge ($self->edges) {
- $viz->add_edge(
- $fix->($edge->{from}) => $fix->($edge->{to}),
- fontsize => 9,
- label => $edge->{via},
- );
- }
-
- return $viz;
-}
-
-__PACKAGE__->meta->make_immutable;
-
-no Moose; 1;
-
-__END__
-
-=pod
-
-=head1 SYNOPSIS
-
- my $g = Bread::Board::GraphViz->new;
- $g->add_container( $bread_board_container );
- print $g->graph->as_png;
-
-=head1 SEE ALSO
-
-L<Bread::Board::GraphViz::App>
-
-L<GraphViz>
-
-L<GraphViz::HasA>
-
-=head1 AUTHOR (actual)
-
-Jonathan Rockway - C<< <jrockway at cpan.org> >>
-
-=head1 BUGS
-
-All complex software has bugs lurking in it, and this module is no
-exception. If you find a bug please either email me, or add the bug
-to cpan-RT.
-
-=begin Pod::Coverage
-
- graph
- name_prefix
- service_name
-
-=end Pod::Coverage
-
-=cut
diff --git a/lib/Bread/Board/GraphViz/App.pm b/lib/Bread/Board/GraphViz/App.pm
deleted file mode 100644
index fdba4b4..0000000
--- a/lib/Bread/Board/GraphViz/App.pm
+++ /dev/null
@@ -1,54 +0,0 @@
-package Bread::Board::GraphViz::App;
-use Moose;
-# ABSTRACT: display a L<Bread::Board>'s dependency graph
-
-use Bread::Board::GraphViz;
-
-with 'MooseX::Runnable';
-
-sub run {
- my ($self, @code) = @_;
- my $board = eval( 'no strict; '. join ' ', @code );
- die if $@;
-
- if(!blessed $board || !$board->isa('Bread::Board::Container')){
- print {*STDERR} "That code did not evaluate to a Bread::Board::Container.\n";
- return 1;
- }
-
- my $g = Bread::Board::GraphViz->new;
- $g->add_container($board);
- print $g->graph->as_debug;
-
- return 0;
-}
-
-__PACKAGE__->meta->make_immutable;
-
-no Moose; 1;
-
-__END__
-
-=pod
-
-=head1 SYNOPSIS
-
-See L<visualize-breadboard.pl>.
-
-=head1 AUTHOR (actual)
-
-Jonathan Rockway - C<< <jrockway at cpan.org> >>
-
-=head1 BUGS
-
-All complex software has bugs lurking in it, and this module is no
-exception. If you find a bug please either email me, or add the bug
-to cpan-RT.
-
-=begin Pod::Coverage
-
- run
-
-=end Pod::Coverage
-
-=cut
diff --git a/t/500_graphviz.t b/t/500_graphviz.t
deleted file mode 100644
index f3c66b4..0000000
--- a/t/500_graphviz.t
+++ /dev/null
@@ -1,38 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-use Test::Fatal;
-
-BEGIN {
- eval 'use Bread::Board::GraphViz; 1' or
- plan skip_all => 'you need the optional deps to do the graphviz stuff';
-}
-
-my $example_board = do('t/lib/graphable.bb');
-
-my $g = Bread::Board::GraphViz->new;
-is(exception {
- $g->add_container($example_board);
-}, undef, 'adding works');
-
-is_deeply [ sort map { $_->name } $g->services ], [
- sort qw/config_file dsn logger database login login template_dir name/,
-], 'visited all the services';
-
-sub cmp_edges {
- join(' => ', @$a) cmp join(' => ', @$b);
-}
-
-is_deeply [ sort cmp_edges map { [$_->{from}, $_->{to}] } $g->edges ], [
- ['/config/config_file' => '/name' ],
- ['/config/dsn' => '/config/config_file'],
- ['/config/dsn' => '/logger'],
- ['/database' => '/config/dsn'],
- ['/database' => '/logger'],
- ['/pages/login' => '/database'],
- ['/pages/login' => '/logger'],
- ['/pages/login' => '/templates/login'],
- ['/templates/login' => '/config/template_dir'],
-], 'added all the edges';
-
-done_testing;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libbread-board-perl.git
More information about the Pkg-perl-cvs-commits
mailing list