Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

convert to dzil

  • Loading branch information...
commit 315615b12aae0e18fba3387b77cc002ae1eb5732 1 parent 80f5f4e
@doy doy authored
Showing with 188 additions and 452 deletions.
  1. +13 −4 .gitignore
  2. +2 −0  ChangeLog → Changes
  3. +0 −25 MANIFEST.SKIP
  4. +0 −34 Makefile.PL
  5. +0 −32 README
  6. +3 −5 bin/visualize-breadboard
  7. +31 −0 dist.ini
  8. +5 −7 lib/Bread/Board.pm
  9. +0 −7 lib/Bread/Board/BlockInjection.pm
  10. +0 −7 lib/Bread/Board/ConstructorInjection.pm
  11. +6 −7 lib/Bread/Board/Container.pm
  12. +8 −7 lib/Bread/Board/Container/Parameterized.pm
  13. +0 −7 lib/Bread/Board/Dependency.pm
  14. +0 −7 lib/Bread/Board/Dumper.pm
  15. +1 −7 lib/Bread/Board/GraphViz.pm
  16. +1 −7 lib/Bread/Board/GraphViz/App.pm
  17. +0 −3  lib/Bread/Board/LifeCycle.pm
  18. +0 −7 lib/Bread/Board/LifeCycle/Singleton.pm
  19. +6 −7 lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm
  20. +0 −7 lib/Bread/Board/Literal.pm
  21. +2 −4 lib/Bread/Board/Manual.pod
  22. +3 −4 lib/Bread/Board/Manual/Concepts.pod
  23. +2 −4 lib/Bread/Board/Manual/Concepts/Advanced.pod
  24. +3 −5 lib/Bread/Board/Manual/Concepts/Typemap.pod
  25. +3 −4 lib/Bread/Board/Manual/Example.pod
  26. +2 −4 lib/Bread/Board/Manual/Example/FormSensible.pod
  27. +2 −4 lib/Bread/Board/Manual/Example/LogDispatch.pod
  28. +4 −7 lib/Bread/Board/Service.pm
  29. +0 −3  lib/Bread/Board/Service/Alias.pm
  30. +9 −7 lib/Bread/Board/Service/Deferred.pm
  31. +0 −7 lib/Bread/Board/Service/Deferred/Thunk.pm
  32. +8 −7 lib/Bread/Board/Service/Inferred.pm
  33. +0 −7 lib/Bread/Board/Service/WithClass.pm
  34. +0 −7 lib/Bread/Board/Service/WithDependencies.pm
  35. +2 −7 lib/Bread/Board/Service/WithParameters.pm
  36. +0 −7 lib/Bread/Board/SetterInjection.pm
  37. +0 −7 lib/Bread/Board/Traversable.pm
  38. +0 −7 lib/Bread/Board/Types.pm
  39. +0 −104 t/000_load.t
  40. +8 −8 t/002_setter_injection.t
  41. +9 −9 t/010_container.t
  42. +33 −33 t/030_lifecycle_singleton.t
  43. +0 −9 t/author/pod.t
  44. +22 −0 xt/release/pod-coverage.t
View
17 .gitignore
@@ -1,8 +1,17 @@
-META.yml
+cover_db
+META.*
+MYMETA.*
Makefile
blib
-pm_to_blib
-.DS_Store
-Makefile.old
inc
+pm_to_blib
MANIFEST
+Makefile.old
+nytprof.out
+MANIFEST.bak
+*.sw[po]
+.DS_Store
+.build
+Bread-Board-*
+*.bs
+*.o
View
2  ChangeLog → Changes
@@ -1,5 +1,7 @@
Revision history for Perl extension Bread::Board
+{{$NEXT}}
+
0.21 Tues. Sept. 6th, 2011
* Bread::Board
- Allow service() and alias() sugar functions to
View
25 MANIFEST.SKIP
@@ -1,25 +0,0 @@
-^_build
-^Build$
-^Build.PL$
-^blib
-~$
-\.bak$
-^MANIFEST\.SKIP$
-CVS
-\.git
-\.svn
-\.DS_Store
-cover_db
-\..*\.sw.?$
-^Makefile$
-^pm_to_blib$
-^MakeMaker-\d
-^blibdirs$
-\.old$
-^#.*#$
-^\.#
-^TODO$
-^PLAN$
-^benchmarks$
-^\._.*$
-^misc/
View
34 Makefile.PL
@@ -1,34 +0,0 @@
-use strict;
-use warnings;
-use inc::Module::Install 0.91;
-use Module::Install::AuthorTests;
-
-name 'Bread-Board';
-all_from 'lib/Bread/Board.pm';
-auto_set_repository;
-license 'perl';
-
-# prereqs
-requires 'Moose' => '1.00';
-requires 'Class::MOP' => '1.00';
-requires 'MooseX::Clone' => '0.05';
-requires 'MooseX::Params::Validate' => '0.14';
-
-# things the tests need
-build_requires 'Test::More' => '0.62';
-build_requires 'Test::Exception' => '0.21';
-
-# if you want graphviz graphs, you'll need
-# requires 'Data::Visitor::Callback';
-# requires 'GraphViz';
-# requires 'MooseX::Runnable';
-# requires 'MooseX::Types::Set::Object';
-# requires 'Set::Object';
-
-tests('t/*.t');
-author_tests('t/author/*.t');
-
-install_script 'bin/visualize-breadboard';
-
-WriteAll();
-
View
32 README
@@ -1,32 +0,0 @@
-Bread::Board version 0.21
-===========================
-
-See the individual module documentation for more information
-
-INSTALLATION
-
-To install this module type the following:
-
- perl Makefile.PL
- make
- make test
- make install
-
-DEPENDENCIES
-
-This module requires these other modules and libraries:
-
- Moose
- MooseX::Params::Validate
- MooseX::Clone
- Sub::Exporter
-
-COPYRIGHT AND LICENCE
-
-Copyright (C) 2007-2011 Infinity Interactive, Inc.
-
-http://www.iinteractive.com
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
View
8 bin/visualize-breadboard
@@ -1,6 +1,8 @@
#!/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";
@@ -15,10 +17,6 @@ __END__
=pod
-=head1 NAME
-
-visualize-breadboard - script to invoke L<Bread::Board::GraphViz::App>
-
=head1 SYNOPSIS
$ visualize-breadboard 'use MyApp; MyApp->get_breadboard'
@@ -52,4 +50,4 @@ 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
+=cut
View
31 dist.ini
@@ -0,0 +1,31 @@
+name = Bread-Board
+author = Stevan Little <stevan@iinteractive.com>
+license = Perl_5
+copyright_holder = Infinity Interactive
+
+[@Filter]
+-bundle = @DOY
+-remove = PodCoverageTests
+dist = Bread-Board
+CompileTests_skip = GraphViz|visualize
+
+[Authority]
+authority = cpan:STEVAN
+
+[Prereqs]
+Moose = 1.00
+MooseX::Clone = 0.05
+MooseX::Params::Validate = 0.14
+Try::Tiny = 0
+
+[Prereqs / TestRequires]
+Test::Exception = 0.21
+Test::Fatal = 0
+Test::Moose = 0
+
+[Prereqs / RuntimeRecommends]
+Data::Visitor::Callback = 0
+GraphViz = 0
+MooseX::Runnable = 0
+MooseX::Types::Set::Object = 0
+Set::Object = 0
View
12 lib/Bread/Board.pm
@@ -3,6 +3,7 @@ use strict;
use warnings;
use Carp qw(confess);
use Scalar::Util qw(blessed);
+# ABSTRACT: A solderless way to wire up your application components
use Bread::Board::Types;
use Bread::Board::ConstructorInjection;
@@ -31,9 +32,6 @@ Moose::Exporter->setup_import_methods(
]],
);
-our $AUTHORITY = 'cpan:STEVAN';
-our $VERSION = '0.21';
-
sub as (&) { $_[0] }
our $CC;
@@ -187,10 +185,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board - A solderless way to wire up your application components
-
=head1 SYNOPSIS
use Bread::Board;
@@ -313,6 +307,10 @@ Want to know more? See the L<Bread::Board::Manual>.
=item I<include ($file)>
+=item I<alias ($service_name, $service_path, %service_description)>
+
+=item I<set_root_container ($container)>
+
=back
=head1 ACKNOWLEDGEMENTS
View
7 lib/Bread/Board/BlockInjection.pm
@@ -1,9 +1,6 @@
package Bread::Board::BlockInjection;
use Moose;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Service::WithParameters',
'Bread::Board::Service::WithDependencies';
@@ -34,10 +31,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::BlockInjection
-
=head1 DESCRIPTION
=head1 METHODS
View
7 lib/Bread/Board/ConstructorInjection.pm
@@ -5,9 +5,6 @@ use Try::Tiny;
use Bread::Board::Types;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Service::WithClass',
'Bread::Board::Service::WithParameters',
'Bread::Board::Service::WithDependencies';
@@ -40,10 +37,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::ConstructorInjection
-
=head1 DESCRIPTION
=head1 METHODS
View
13 lib/Bread/Board/Container.pm
@@ -5,9 +5,6 @@ use MooseX::Params::Validate;
use Bread::Board::Types;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Traversable';
has 'name' => (
@@ -185,10 +182,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Container
-
=head1 DESCRIPTION
=head1 METHODS
@@ -225,6 +218,12 @@ Bread::Board::Container
=item B<resolve ( ?service => $service_name, ?type => $type, ?parameters => { ... } )>
+=item B<add_type_mapping_for ( $type_name, $service )>
+
+=item B<get_type_mapping_for ( $type_name )>
+
+=item B<has_type_mapping_for ( $type_name )>
+
=back
=head1 BUGS
View
15 lib/Bread/Board/Container/Parameterized.pm
@@ -1,11 +1,9 @@
package Bread::Board::Container::Parameterized;
use Moose;
+# ABSTRACT: A parameterized container
use Bread::Board::Container;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Traversable';
has 'name' => (
@@ -81,10 +79,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Container::Parameterized - A parameterized container
-
=head1 DESCRIPTION
=head1 ATTRIBUTES
@@ -126,4 +120,11 @@ 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.
+=begin Pod::Coverage
+
+fetch
+resolve
+
+=end Pod::Coverage
+
=cut
View
7 lib/Bread/Board/Dependency.pm
@@ -3,9 +3,6 @@ use Moose;
use Bread::Board::Service;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Traversable';
has 'service_path' => (
@@ -53,10 +50,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Dependency
-
=head1 DESCRIPTION
=head1 METHODS
View
7 lib/Bread/Board/Dumper.pm
@@ -1,9 +1,6 @@
package Bread::Board::Dumper;
use Moose;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
sub dump {
my ($self, $thing, $indent) = @_;
@@ -48,10 +45,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Dumper
-
=head1 SYNOPSIS
use Bread::Board::Dumper;
View
8 lib/Bread/Board/GraphViz.pm
@@ -1,5 +1,6 @@
package Bread::Board::GraphViz;
use Moose;
+# ABSTRACT: visualize L<Bread::Board> dependency graphs
use Data::Visitor::Callback;
use GraphViz;
@@ -7,9 +8,6 @@ use List::Util qw(reduce);
use MooseX::Types::Set::Object;
use Set::Object qw(set);
-our $AUTHORITY = 'cpan:STEVAN';
-our $VERSION = '0.21';
-
# edges is built incrementally, as a user may provide many "root" containers
has 'edges' => (
init_arg => 'edges', # feel free to supply your own
@@ -124,10 +122,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::GraphViz - visualize L<Bread::Board> dependency graphs
-
=head1 SYNOPSIS
my $g = Bread::Board::GraphViz->new;
View
8 lib/Bread/Board/GraphViz/App.pm
@@ -1,11 +1,9 @@
package Bread::Board::GraphViz::App;
use Moose;
+# ABSTRACT: display a L<Bread::Board>'s dependency graph
use Bread::Board::GraphViz;
-our $AUTHORITY = 'cpan:STEVAN';
-our $VERSION = '0.21';
-
with 'MooseX::Runnable';
sub run {
@@ -33,10 +31,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::GraphViz::App - display a L<Bread::Board>'s dependency graph
-
=head1 SYNOPSIS
See L<visualize-breadboard.pl>.
View
3  lib/Bread/Board/LifeCycle.pm
@@ -1,9 +1,6 @@
package Bread::Board::LifeCycle;
use Moose::Role;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
no Moose::Role; 1;
__END__
View
7 lib/Bread/Board/LifeCycle/Singleton.pm
@@ -5,9 +5,6 @@ use Try::Tiny;
with 'Bread::Board::LifeCycle';
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
has 'instance' => (
traits => [ 'NoClone' ],
is => 'rw',
@@ -63,10 +60,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::LifeCycle::Singleton
-
=head1 DESCRIPTION
=head1 METHODS
View
13 lib/Bread/Board/LifeCycle/Singleton/WithParameters.pm
@@ -3,9 +3,6 @@ use Moose::Role;
with 'Bread::Board::LifeCycle';
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
has 'instances' => (
traits => [ 'Hash', 'NoClone' ],
is => 'rw',
@@ -53,10 +50,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::LifeCycle::Singleton::WithParameters
-
=head1 DESCRIPTION
=head1 METHODS
@@ -92,4 +85,10 @@ 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.
+=begin Pod::Coverage
+
+generate_instance_key
+
+=end Pod::Coverage
+
=cut
View
7 lib/Bread/Board/Literal.pm
@@ -1,9 +1,6 @@
package Bread::Board::Literal;
use Moose;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Service';
has 'value' => (
@@ -22,10 +19,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Literal
-
=head1 DESCRIPTION
=head1 METHODS
View
6 lib/Bread/Board/Manual.pod
@@ -1,10 +1,8 @@
+# PODNAME: Bread::Board::Manual
+# ABSTRACT: A manual for Bread::Board
=pod
-=head1 NAME
-
-Bread::Board::Manual - A manual for Bread::Board
-
=head1 INTRODUCTION
As we have said, Bread::Board is an inversion of control
View
7 lib/Bread/Board/Manual/Concepts.pod
@@ -1,8 +1,7 @@
-=pod
-
-=head1 NAME
+# PODNAME: Bread::Board::Manual::Concepts
+# ABSTRACT: An overview of the concepts in Bread::Board
-Bread::Board::Manual::Concepts - An overview of the concepts in Bread::Board
+=pod
=head1 INTRODUCTION
View
6 lib/Bread/Board/Manual/Concepts/Advanced.pod
@@ -1,10 +1,8 @@
+# PODNAME: Bread::Board::Manual::Concepts::Advanced
+# ABSTRACT: An overview of some of the more advanced Bread::Board concepts
=pod
-=head1 NAME
-
-Bread::Board::Manual::Concepts::Advanced - An overview of some of the more advanced Bread::Board concepts
-
=head1 INTRODUCTION
In the L<Bread::Board::Manual::Concepts> document we attempted to
View
8 lib/Bread/Board/Manual/Concepts/Typemap.pod
@@ -1,10 +1,8 @@
+# PODNAME: Bread::Board::Manual::Concepts::Typemap
+# ABSTRACT: An overview of the typemapping feature
=pod
-=head1 NAME
-
-Bread::Board::Manual::Concepts::Typemap - An overview of the typemapping feature
-
=head1 INTRODUCTION
A new (read: experimental) feature of Bread::Board is typemapped services.
@@ -144,4 +142,4 @@ 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
+=cut
View
7 lib/Bread/Board/Manual/Example.pod
@@ -1,8 +1,7 @@
-=pod
-
-=head1 NAME
+# PODNAME: Bread::Board::Manual::Example
+# ABSTRACT: A set of examples of Bread::Board usage
-Bread::Board::Manual::Example - A set of examples of Bread::Board usage
+=pod
=head1 DESCRIPTION
View
6 lib/Bread/Board/Manual/Example/FormSensible.pod
@@ -1,10 +1,8 @@
+# PODNAME: Bread::Board::Manual::Example::FormSensible
+# ABSTRACT: A Form::Sensible and Catalyst example.
=pod
-=head1 NAME
-
-Bread::Board::Manual::Example::FormSensible - A Form::Sensible and Catalyst example.
-
=head1 SYNOPSIS
__PACKAGE__->config(
View
6 lib/Bread/Board/Manual/Example/LogDispatch.pod
@@ -1,10 +1,8 @@
+# PODNAME: Bread::Board::Manual::Example::LogDispatch
+# ABSTRACT: An example of composing a dynamic Log::Dispatch object.
=pod
-=head1 NAME
-
-Bread::Board::Manual::Example::LogDispatch - An example of composing a dynamic Log::Dispatch object.
-
=head1 SYNOPSIS
my $c = container 'Logging' => as {
View
11 lib/Bread/Board/Service.pm
@@ -1,9 +1,6 @@
package Bread::Board::Service;
use Moose::Role;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Traversable';
has 'name' => (
@@ -77,10 +74,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Service
-
=head1 DESCRIPTION
=head1 METHODS
@@ -99,6 +92,10 @@ Bread::Board::Service
=item B<get>
+=item B<init_params>
+
+=item B<param>
+
=back
=head1 BUGS
View
3  lib/Bread/Board/Service/Alias.pm
@@ -3,9 +3,6 @@ use Moose;
use Try::Tiny;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
has aliased_from_path => (
is => 'ro',
isa => 'Str',
View
16 lib/Bread/Board/Service/Deferred.pm
@@ -1,9 +1,6 @@
package Bread::Board::Service::Deferred;
use Moose ();
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
use overload
# cover your basic operatins ...
'bool' => sub { 1 },
@@ -87,10 +84,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Service::Deferred
-
=head1 DESCRIPTION
No user servicable parts. Read the source if you are interested.
@@ -114,4 +107,13 @@ 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.
+=begin Pod::Coverage
+
+can
+isa
+meta
+new
+
+=end Pod::Coverage
+
=cut
View
7 lib/Bread/Board/Service/Deferred/Thunk.pm
@@ -1,9 +1,6 @@
package Bread::Board::Service::Deferred::Thunk;
use Moose;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
has 'thunk' => (
traits => [ 'Code' ],
is => 'bare',
@@ -20,10 +17,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Service::Deferred::Thunk
-
=head1 DESCRIPTION
No user servicable parts. Read the source if you are interested.
View
15 lib/Bread/Board/Service/Inferred.pm
@@ -2,9 +2,6 @@ package Bread::Board::Service::Inferred;
use Moose;
use Moose::Util::TypeConstraints 'find_type_constraint';
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
use Try::Tiny;
use Bread::Board::Types;
use Bread::Board::ConstructorInjection;
@@ -216,16 +213,20 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Service::Inferred
-
=head1 DESCRIPTION
CAUTION, EXPERIMENTAL FEATURE.
Docs to come, as well as refactoring.
+=head1 METHODS
+
+=over 4
+
+=item B<infer_service>
+
+=back
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
View
7 lib/Bread/Board/Service/WithClass.pm
@@ -3,9 +3,6 @@ use Moose::Role;
use Bread::Board::Types;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Service';
has 'class' => (
@@ -24,10 +21,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Service::WithClass
-
=head1 DESCRIPTION
=head1 METHODS
View
7 lib/Bread/Board/Service/WithDependencies.pm
@@ -7,9 +7,6 @@ use Bread::Board::Types;
use Bread::Board::Service::Deferred;
use Bread::Board::Service::Deferred::Thunk;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Service';
has 'dependencies' => (
@@ -107,10 +104,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Service::WithDependencies
-
=head1 DESCRIPTION
=head1 METHODS
View
9 lib/Bread/Board/Service/WithParameters.pm
@@ -4,9 +4,6 @@ use MooseX::Params::Validate qw(validated_hash);
use Bread::Board::Types;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Service';
has 'parameters' => (
@@ -77,10 +74,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Service::WithParameters
-
=head1 DESCRIPTION
=head1 METHODS
@@ -93,6 +86,8 @@ Bread::Board::Service::WithParameters
=item B<has_parameters>
+=item B<has_parameter_defaults>
+
=item B<has_required_parameters>
=item B<check_parameters>
View
7 lib/Bread/Board/SetterInjection.pm
@@ -3,9 +3,6 @@ use Moose;
use Bread::Board::Types;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Bread::Board::Service::WithClass',
'Bread::Board::Service::WithParameters',
'Bread::Board::Service::WithDependencies';
@@ -25,10 +22,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::SetterInjection
-
=head1 DESCRIPTION
=head1 METHODS
View
7 lib/Bread/Board/Traversable.pm
@@ -1,9 +1,6 @@
package Bread::Board::Traversable;
use Moose::Role;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'MooseX::Clone';
has 'parent' => (
@@ -99,10 +96,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Traversable
-
=head1 SYNOPSIS
=head1 DESCRIPTION
View
7 lib/Bread/Board/Types.pm
@@ -6,9 +6,6 @@ use Scalar::Util qw(blessed);
use Bread::Board::Service;
use Bread::Board::Dependency;
-our $VERSION = '0.21';
-our $AUTHORITY = 'cpan:STEVAN';
-
enum 'Bread::Board::Service::LifeCycles' => qw[
Null
Singleton
@@ -103,10 +100,6 @@ __END__
=pod
-=head1 NAME
-
-Bread::Board::Types
-
=head1 DESCRIPTION
=head1 BUGS
View
104 t/000_load.t
@@ -1,104 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use Test::More tests => 16;
-use Test::Exception;
-
-BEGIN {
- use_ok('Bread::Board');
-
- use_ok('Bread::Board::Types');
-
- # roles
- use_ok('Bread::Board::Service');
- use_ok('Bread::Board::Service::WithClass');
- use_ok('Bread::Board::Service::WithDependencies');
- use_ok('Bread::Board::Service::WithParameters');
-
- # services
- use_ok('Bread::Board::ConstructorInjection');
- use_ok('Bread::Board::SetterInjection');
- use_ok('Bread::Board::BlockInjection');
- use_ok('Bread::Board::Literal');
-
- use_ok('Bread::Board::Container');
- use_ok('Bread::Board::Dependency');
-
- use_ok('Bread::Board::Traversable');
-
- use_ok('Bread::Board::LifeCycle::Singleton');
-}
-
-{
- package MyFileLogger;
- use Moose;
- has 'log_file_name' => (is => 'ro', required => 1);
-
- package MyDBI;
- use Moose;
-
- has 'dsn' => (is => 'ro', isa => 'Str');
- has 'username' => (is => 'ro', isa => 'Str');
- has 'password' => (is => 'ro', isa => 'Str');
-
- sub connect {
- my ($class, $dsn, $username, $password) = @_;
- $class->new(dsn => $dsn, username => $username, password => $password);
- }
-
- package MyApplication;
- use Moose;
- has 'dbh' => (is => 'ro', isa => 'MyDBI', required => 1);
- has 'logger' => (is => 'ro', isa => 'MyFileLogger', required => 1);
-
- sub run { 1 }
-}
-
-my $c;
-lives_ok {
- $c = container 'MyApp' => as {
-
- service 'log_file_name' => "logfile.log";
-
- service 'logger' => (
- class => 'MyFileLogger',
- lifecycle => 'Singleton',
- dependencies => [
- depends_on('log_file_name'),
- ]
- );
-
- container 'Database' => as {
- service 'dsn' => "dbi:sqlite:dbname=my-app.db";
- service 'username' => "user234";
- service 'password' => "****";
-
- service 'dbh' => (
- block => sub {
- my $s = shift;
- MyDBI->connect(
- $s->param('dsn'),
- $s->param('username'),
- $s->param('password'),
- ) || die "Could not connect";
- },
- dependencies => wire_names(qw[dsn username password])
- );
- };
-
- service 'application' => (
- class => 'MyApplication',
- dependencies => {
- logger => depends_on('logger'),
- dbh => depends_on('Database/dbh'),
- }
- );
-
- };
-} '... container compiled successfully';
-
-
-ok($c->fetch('application')->get->run, '... the applicaton ran');
-
View
16 t/002_setter_injection.t
@@ -8,23 +8,23 @@ use Test::Moose;
use Test::Exception;
BEGIN {
- use_ok('Bread::Board::SetterInjection');
- use_ok('Bread::Board::Literal');
+ use_ok('Bread::Board::SetterInjection');
+ use_ok('Bread::Board::Literal');
}
{
package Needle;
use Moose;
-
+
package Mexican::Black::Tar;
use Moose;
-
+
package Addict;
use Moose;
-
+
has 'needle' => (is => 'rw');
has 'spoon' => (is => 'rw');
- has 'stash' => (is => 'rw');
+ has 'stash' => (is => 'rw');
}
my $s = Bread::Board::SetterInjection->new(
@@ -32,7 +32,7 @@ my $s = Bread::Board::SetterInjection->new(
class => 'Addict',
dependencies => {
needle => Bread::Board::SetterInjection->new(name => 'spike', class => 'Needle'),
- spoon => Bread::Board::Literal->new(name => 'works', value => 'Spoon!'),
+ spoon => Bread::Board::Literal->new(name => 'works', value => 'Spoon!'),
},
parameters => {
stash => { isa => 'Mexican::Black::Tar' }
@@ -54,7 +54,7 @@ does_ok($s, 'Bread::Board::Service');
{
- my $i2 = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2 = $s->get(stash => Mexican::Black::Tar->new);
isnt($i, $i2, '... calling it again returns an new object');
}
}
View
18 t/010_container.t
@@ -10,13 +10,13 @@ use Test::Exception;
BEGIN {
use_ok('Bread::Board::Container');
use_ok('Bread::Board::ConstructorInjection');
- use_ok('Bread::Board::Literal');
+ use_ok('Bread::Board::Literal');
}
my $c = Bread::Board::Container->new(name => '/');
isa_ok($c, 'Bread::Board::Container');
-$c->add_sub_container(
+$c->add_sub_container(
Bread::Board::Container->new(
name => 'Application',
sub_containers => [
@@ -45,9 +45,9 @@ $c->add_sub_container(
tt_include_path => Bread::Board::Literal->new(name => 'include_path', value => []),
},
)
- ]
+ ]
),
- Bread::Board::Container->new(name => 'Controller'),
+ Bread::Board::Container->new(name => 'Controller'),
]
)
);
@@ -74,10 +74,10 @@ is($app->name, 'Application', '... got the right container');
is($view->parent, $app, '... app is the parent of the view');
ok($view->has_services, '... the veiw has services');
-
+
my $service = $view->get_service('TT');
does_ok($service, 'Bread::Board::Service');
-
+
is($service->parent, $view, '... the parent of the service is the view');
}
{
@@ -88,11 +88,11 @@ is($app->name, 'Application', '... got the right container');
is($model->parent, $app, '... app is the parent of the model');
ok($model->has_services, '... the model has services');
-
+
my $service = $model->get_service('schema');
does_ok($service, 'Bread::Board::Service');
-
- is($service->parent, $model, '... the parent of the service is the model');
+
+ is($service->parent, $model, '... the parent of the service is the model');
}
View
66 t/030_lifecycle_singleton.t
@@ -8,33 +8,33 @@ use Test::Moose;
use Test::Exception;
BEGIN {
- use_ok('Bread::Board::ConstructorInjection');
- use_ok('Bread::Board::LifeCycle::Singleton');
- use_ok('Bread::Board::Literal');
+ use_ok('Bread::Board::ConstructorInjection');
+ use_ok('Bread::Board::LifeCycle::Singleton');
+ use_ok('Bread::Board::Literal');
}
{
package Needle;
use Moose;
-
+
package Mexican::Black::Tar;
use Moose;
-
+
package Addict;
use Moose;
-
+
has 'needle' => (is => 'ro');
has 'spoon' => (is => 'ro');
- has 'stash' => (is => 'ro');
+ has 'stash' => (is => 'ro');
}
my $s = Bread::Board::ConstructorInjection->new(
- lifecycle => 'Singleton',
+ lifecycle => 'Singleton',
name => 'William',
class => 'Addict',
dependencies => {
needle => Bread::Board::ConstructorInjection->new(name => 'spike', class => 'Needle'),
- spoon => Bread::Board::Literal->new(name => 'works', value => 'Spoon!'),
+ spoon => Bread::Board::Literal->new(name => 'works', value => 'Spoon!'),
},
parameters => {
stash => { isa => 'Mexican::Black::Tar' }
@@ -60,54 +60,54 @@ is($i->spoon, 'Spoon!', '... got our literal service');
isa_ok($i->stash, 'Mexican::Black::Tar');
{
- my $i2 = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2 = $s->get(stash => Mexican::Black::Tar->new);
is($i, $i2, '... calling it again returns the same object');
}
$s->flush_instance;
{
- my $i2 = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2 = $s->get(stash => Mexican::Black::Tar->new);
isnt($i, $i2, '... calling it again returns an new object');
-
+
{
- my $i2a = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2a = $s->get(stash => Mexican::Black::Tar->new);
is($i2, $i2a, '... calling it again returns the same object');
- }
-
+ }
+
$s->lifecycle('Null');
- ok(!$s->can('flush_instance'), '... we can no longer call flush_instance');
- ok(!$s->can('instance'), '... we can no longer call instance');
- ok(!$s->can('has_instance'), '... we can no longer call has_instance');
-
- is($s->lifecycle, 'Null', '... got the right lifecycle');
-
+ ok(!$s->can('flush_instance'), '... we can no longer call flush_instance');
+ ok(!$s->can('instance'), '... we can no longer call instance');
+ ok(!$s->can('has_instance'), '... we can no longer call has_instance');
+
+ is($s->lifecycle, 'Null', '... got the right lifecycle');
+
{
- my $i2a = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2a = $s->get(stash => Mexican::Black::Tar->new);
isnt($i2, $i2a, '... calling it again returns a new object');
-
+
{
- my $i2a1 = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2a1 = $s->get(stash => Mexican::Black::Tar->new);
isnt($i2, $i2a1, '... calling it again returns a new object as before');
- isnt($i2a, $i2a1, '... calling it again returns a new object');
- }
- }
+ isnt($i2a, $i2a1, '... calling it again returns a new object');
+ }
+ }
}
$s->lifecycle('Singleton');
-ok($s->can('flush_instance'), '... we can no longer call flush_instance');
-ok($s->can('instance'), '... we can no longer call instance');
+ok($s->can('flush_instance'), '... we can no longer call flush_instance');
+ok($s->can('instance'), '... we can no longer call instance');
ok($s->can('has_instance'), '... we can no longer call has_instance');
is($s->lifecycle, 'Singleton', '... got the right lifecycle');
{
- my $i2 = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2 = $s->get(stash => Mexican::Black::Tar->new);
isnt($i, $i2, '... calling it again returns the same object');
-
+
{
- my $i2a = $s->get(stash => Mexican::Black::Tar->new);
+ my $i2a = $s->get(stash => Mexican::Black::Tar->new);
is($i2, $i2a, '... calling it again returns the same object');
- }
+ }
}
View
9 t/author/pod.t
@@ -1,9 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use Test::More;
-use Test::Pod 1.14;
-
-all_pod_files_ok();
View
22 xt/release/pod-coverage.t
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use Test::Requires {
+ 'Test::Pod::Coverage' => '1.04', # skip all if not installed
+ 'Pod::Coverage::TrustPod' => '0',
+};
+
+# This is a stripped down version of all_pod_coverage_ok which lets us
+# vary the trustme parameter per module.
+my @modules
+ = grep { !/GraphViz/ } all_modules();
+plan tests => scalar @modules;
+
+for my $module (sort @modules) {
+ pod_coverage_ok($module, { coverage_class => 'Pod::Coverage::TrustPod' },
+ "Pod coverage for $module");
+}
Please sign in to comment.
Something went wrong with that request. Please try again.